capacitor-auth-manager 2.4.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/AI-INTEGRATION-GUIDE.md +174 -0
  2. package/CHANGELOG.md +119 -0
  3. package/CapacitorAuthManager.podspec +3 -3
  4. package/README.md +91 -72
  5. package/android/build.gradle +17 -25
  6. package/android/consumer-rules.pro +2 -0
  7. package/android/proguard-rules.pro +5 -30
  8. package/android/src/main/AndroidManifest.xml +4 -9
  9. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/AuthErrorCodes.java +32 -0
  10. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/AuthException.java +34 -0
  11. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/AuthStorage.java +46 -25
  12. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/CapacitorAuthManager.java +54 -38
  13. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/CapacitorAuthManagerPlugin.java +77 -54
  14. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/GoogleAuthProvider.java +171 -41
  15. package/android/src/main/java/com/aoneahsan/capacitor_auth_manager/ProviderFactory.java +5 -0
  16. package/dist/angular.cjs.js +421 -3376
  17. package/dist/core.cjs.js +589 -149
  18. package/dist/esm/angular/auth.guard.d.ts +1 -1
  19. package/dist/esm/angular/auth.module.d.ts +1 -1
  20. package/dist/esm/angular/auth.module.js +1 -1
  21. package/dist/esm/angular/auth.service.d.ts +2 -2
  22. package/dist/esm/angular/auth.service.js +1 -1
  23. package/dist/esm/angular/index.d.ts +4 -4
  24. package/dist/esm/angular/index.js +4 -4
  25. package/dist/esm/capacitor-plugin.d.ts +2 -3
  26. package/dist/esm/capacitor-plugin.js +14 -4
  27. package/dist/esm/core/auth-manager.d.ts +20 -2
  28. package/dist/esm/core/auth-manager.js +68 -12
  29. package/dist/esm/core/index.d.ts +5 -4
  30. package/dist/esm/core/index.js +5 -4
  31. package/dist/esm/core/provider-manifests.d.ts +1 -1
  32. package/dist/esm/core/provider-manifests.js +12 -13
  33. package/dist/esm/core/provider-registry.d.ts +8 -5
  34. package/dist/esm/core/provider-registry.js +41 -10
  35. package/dist/esm/core/types.d.ts +2 -2
  36. package/dist/esm/definitions.d.ts +26 -0
  37. package/dist/esm/index.d.ts +12 -12
  38. package/dist/esm/index.js +7 -7
  39. package/dist/esm/package.json +1 -0
  40. package/dist/esm/providers/base-provider.d.ts +7 -8
  41. package/dist/esm/providers/base-provider.js +7 -8
  42. package/dist/esm/providers/native/google-native-provider.d.ts +13 -2
  43. package/dist/esm/providers/native/google-native-provider.js +50 -6
  44. package/dist/esm/providers/oauth-provider.d.ts +2 -2
  45. package/dist/esm/providers/oauth-provider.js +3 -3
  46. package/dist/esm/providers/provider-factory.d.ts +5 -5
  47. package/dist/esm/providers/provider-factory.js +2 -2
  48. package/dist/esm/providers/web/google-provider.d.ts +74 -18
  49. package/dist/esm/providers/web/google-provider.js +391 -117
  50. package/dist/esm/providers/web/index.d.ts +1 -1
  51. package/dist/esm/providers/web/index.js +1 -1
  52. package/dist/esm/react/hooks.d.ts +2 -2
  53. package/dist/esm/react/hooks.js +2 -2
  54. package/dist/esm/react/index.d.ts +3 -3
  55. package/dist/esm/react/index.js +3 -3
  56. package/dist/esm/react/types.d.ts +1 -1
  57. package/dist/esm/utils/auth-error.d.ts +1 -1
  58. package/dist/esm/utils/auth-error.js +1 -1
  59. package/dist/esm/utils/event-emitter.d.ts +1 -1
  60. package/dist/esm/utils/event-emitter.js +1 -1
  61. package/dist/esm/utils/pending-verification-store.js +1 -1
  62. package/dist/esm/utils/storage.d.ts +2 -2
  63. package/dist/esm/utils/storage.js +31 -7
  64. package/dist/esm/vue/composables.d.ts +2 -2
  65. package/dist/esm/vue/composables.js +1 -1
  66. package/dist/esm/vue/index.d.ts +2 -2
  67. package/dist/esm/vue/index.js +2 -2
  68. package/dist/esm/web.d.ts +1 -1
  69. package/dist/esm/web.js +6 -6
  70. package/dist/plugin.cjs.js +291 -2771
  71. package/dist/plugin.js +585 -147
  72. package/dist/providers-web.cjs.js +1317 -0
  73. package/dist/react.cjs.js +310 -3265
  74. package/dist/vue.cjs.js +266 -3221
  75. package/ios/Plugin/AuthStorage.swift +3 -1
  76. package/ios/Plugin/GoogleAuthProvider.swift +7 -4
  77. package/ios/Plugin/Models.swift +28 -0
  78. package/ios/Plugin/Plugin.swift +64 -40
  79. package/package.json +55 -33
  80. package/scripts/configure.js +71 -325
@@ -17,10 +17,12 @@ import androidx.credentials.GetCredentialResponse;
17
17
  import androidx.credentials.exceptions.ClearCredentialException;
18
18
  import androidx.credentials.exceptions.GetCredentialCancellationException;
19
19
  import androidx.credentials.exceptions.GetCredentialException;
20
+ import androidx.credentials.exceptions.GetCredentialInterruptedException;
20
21
  import androidx.credentials.exceptions.NoCredentialException;
21
22
 
22
23
  import com.getcapacitor.JSObject;
23
24
  import com.google.android.libraries.identity.googleid.GetGoogleIdOption;
25
+ import com.google.android.libraries.identity.googleid.GetSignInWithGoogleOption;
24
26
  import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential;
25
27
 
26
28
  import org.json.JSONArray;
@@ -80,6 +82,8 @@ public class GoogleAuthProvider implements BaseAuthProvider {
80
82
  private String nonce;
81
83
  private String hostedDomain;
82
84
  private String loginHint;
85
+ /** "auto" (bottom sheet, then button on NoCredentialException) | "bottom-sheet" | "button". */
86
+ private String androidFlow = "auto";
83
87
 
84
88
  private JSObject currentUser;
85
89
 
@@ -129,6 +133,12 @@ public class GoogleAuthProvider implements BaseAuthProvider {
129
133
  this.loginHint = loginHint;
130
134
  }
131
135
 
136
+ public void setAndroidFlow(String androidFlow) {
137
+ if (androidFlow != null && !androidFlow.isEmpty()) {
138
+ this.androidFlow = androidFlow;
139
+ }
140
+ }
141
+
132
142
  // ---- BaseAuthProvider ----
133
143
 
134
144
  @Override
@@ -136,8 +146,8 @@ public class GoogleAuthProvider implements BaseAuthProvider {
136
146
  logger.info("Initializing Google auth provider (Credential Manager)");
137
147
  try {
138
148
  // Credential Manager has no "last signed-in account" concept, so restore any persisted
139
- // user from secure storage to keep getCurrentUser() working after a cold start.
140
- JSObject storedUser = storage.getCredential(STORAGE_USER_KEY);
149
+ // profile metadata from storage to keep getCurrentUser() working after a cold start.
150
+ JSObject storedUser = storage.getUser(STORAGE_USER_KEY);
141
151
  if (storedUser != null) {
142
152
  currentUser = storedUser;
143
153
  logger.info("Restored previous Google session from storage");
@@ -145,14 +155,53 @@ public class GoogleAuthProvider implements BaseAuthProvider {
145
155
  callback.onResult(CapacitorAuthManager.AuthResult.success(null));
146
156
  } catch (Exception e) {
147
157
  logger.error("Failed to initialize Google auth provider", e);
148
- callback.onResult(CapacitorAuthManager.AuthResult.error(e));
158
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
159
+ AuthErrorCodes.PROVIDER_INIT_FAILED,
160
+ "Failed to initialize Google auth provider: " + e.getMessage(), e)));
149
161
  }
150
162
  }
151
163
 
152
164
  @Override
153
- public void signIn(JSObject credentials, JSObject options, CapacitorAuthManager.AuthCallback<JSObject> callback) {
154
- logger.info("Starting Google sign-in (Credential Manager)");
155
- requestGoogleCredential(filterByAuthorizedAccounts, autoSelectEnabled, callback);
165
+ public void signIn(JSObject credentials, JSObject options, final CapacitorAuthManager.AuthCallback<JSObject> callback) {
166
+ String flow = androidFlow;
167
+ if (options != null && options.has("androidFlow")) {
168
+ String perCall = options.getString("androidFlow");
169
+ if (perCall != null && !perCall.isEmpty()) {
170
+ flow = perCall;
171
+ }
172
+ }
173
+ logger.info("Starting Google sign-in (Credential Manager, flow=" + flow + ")");
174
+
175
+ if ("button".equals(flow)) {
176
+ requestSignInWithGoogleButton(callback);
177
+ return;
178
+ }
179
+
180
+ final boolean fallbackToButton = !"bottom-sheet".equals(flow);
181
+ requestGoogleCredential(filterByAuthorizedAccounts, autoSelectEnabled, new CapacitorAuthManager.AuthCallback<JSObject>() {
182
+ @Override
183
+ public void onResult(CapacitorAuthManager.AuthResult<JSObject> result) {
184
+ if (result.isSuccess() || !fallbackToButton || !(result.getError() instanceof NoGoogleCredentialException)) {
185
+ callback.onResult(result);
186
+ return;
187
+ }
188
+ // No authorized Google account was offered by the bottom sheet: the explicit
189
+ // "Sign in with Google" button flow lets the user pick or add an account.
190
+ logger.info("No Google credential from the bottom sheet; falling back to the Sign in with Google button flow");
191
+ requestSignInWithGoogleButton(callback);
192
+ }
193
+ });
194
+ }
195
+
196
+ /**
197
+ * Marker so signIn() can distinguish "no account offered" from every other failure. It extends
198
+ * {@link AuthException} because it also reaches JS unchanged when the caller pinned
199
+ * {@code androidFlow: 'bottom-sheet'}, in which case no button fallback runs.
200
+ */
201
+ private static class NoGoogleCredentialException extends AuthException {
202
+ NoGoogleCredentialException(String message) {
203
+ super(AuthErrorCodes.SIGN_IN_FAILED, message);
204
+ }
156
205
  }
157
206
 
158
207
  @Override
@@ -164,7 +213,7 @@ public class GoogleAuthProvider implements BaseAuthProvider {
164
213
  @Override
165
214
  public void getCurrentUser(CapacitorAuthManager.AuthCallback<JSObject> callback) {
166
215
  if (currentUser == null) {
167
- currentUser = storage.getCredential(STORAGE_USER_KEY);
216
+ currentUser = storage.getUser(STORAGE_USER_KEY);
168
217
  }
169
218
  callback.onResult(CapacitorAuthManager.AuthResult.success(currentUser));
170
219
  }
@@ -179,7 +228,8 @@ public class GoogleAuthProvider implements BaseAuthProvider {
179
228
  if (result.isSuccess()) {
180
229
  callback.onResult(result);
181
230
  } else {
182
- callback.onResult(CapacitorAuthManager.AuthResult.error(new Exception(
231
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
232
+ AuthErrorCodes.TOKEN_REFRESH_FAILED,
183
233
  "Re-authentication required: could not silently refresh the Google ID token. "
184
234
  + "Prompt the user to sign in again.")));
185
235
  }
@@ -208,7 +258,7 @@ public class GoogleAuthProvider implements BaseAuthProvider {
208
258
  JSObject storedCredential = storage.getCredential(STORAGE_CREDENTIAL_KEY);
209
259
  if (storedCredential != null) {
210
260
  String idToken = storedCredential.getString("idToken");
211
- if (idToken != null && !idToken.isEmpty()) {
261
+ if (idToken != null && !idToken.isEmpty() && isFreshIdToken(idToken)) {
212
262
  JSObject result = new JSObject();
213
263
  result.put("token", idToken);
214
264
  callback.onResult(CapacitorAuthManager.AuthResult.success(result));
@@ -231,12 +281,21 @@ public class GoogleAuthProvider implements BaseAuthProvider {
231
281
  return;
232
282
  }
233
283
  }
234
- callback.onResult(CapacitorAuthManager.AuthResult.error(new Exception(
284
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
285
+ AuthErrorCodes.NO_AUTH_SESSION,
235
286
  "No Google ID token available. Re-authentication required.")));
236
287
  }
237
288
  });
238
289
  }
239
290
 
291
+ private boolean isFreshIdToken(String idToken) {
292
+ try {
293
+ return parseIdTokenClaims(idToken).optLong("exp", 0) > System.currentTimeMillis() / 1000;
294
+ } catch (Exception invalidToken) {
295
+ return false;
296
+ }
297
+ }
298
+
240
299
  @Override
241
300
  public void revokeAccess(String token, CapacitorAuthManager.AuthCallback<Void> callback) {
242
301
  // Credential Manager has no server-side revoke. Clear the locally-selected account state +
@@ -257,14 +316,16 @@ public class GoogleAuthProvider implements BaseAuthProvider {
257
316
  : clientId;
258
317
 
259
318
  if (resolvedServerClientId == null || resolvedServerClientId.isEmpty()) {
260
- callback.onResult(CapacitorAuthManager.AuthResult.error(new IllegalStateException(
319
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
320
+ AuthErrorCodes.MISSING_CONFIGURATION,
261
321
  "Google sign-in requires a serverClientId (your Web OAuth client id). "
262
322
  + "Provide 'serverClientId' (or 'clientId') in the google provider options.")));
263
323
  return;
264
324
  }
265
325
 
266
326
  if (activity == null) {
267
- callback.onResult(CapacitorAuthManager.AuthResult.error(new IllegalStateException(
327
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
328
+ AuthErrorCodes.PROVIDER_NOT_INITIALIZED,
268
329
  "Google sign-in requires a foreground Activity.")));
269
330
  return;
270
331
  }
@@ -287,32 +348,88 @@ public class GoogleAuthProvider implements BaseAuthProvider {
287
348
  .addCredentialOption(googleIdOption)
288
349
  .build();
289
350
 
290
- CredentialManager credentialManager = CredentialManager.create(context);
291
- Executor executor = ContextCompat.getMainExecutor(context);
351
+ launchCredentialRequest(request, callback);
352
+ } catch (Exception e) {
353
+ logger.error("Failed to start Google Credential Manager request", e);
354
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
355
+ AuthErrorCodes.SIGN_IN_FAILED,
356
+ "Failed to start Google sign-in: " + e.getMessage(), e)));
357
+ }
358
+ }
292
359
 
293
- credentialManager.getCredentialAsync(
294
- activity,
295
- request,
296
- null,
297
- executor,
298
- new CredentialManagerCallback<GetCredentialResponse, GetCredentialException>() {
299
- @Override
300
- public void onResult(GetCredentialResponse response) {
301
- handleSignInResponse(response, callback);
302
- }
360
+ /**
361
+ * The explicit "Sign in with Google" button flow ({@link GetSignInWithGoogleOption}). Unlike the
362
+ * bottom sheet it always shows the account chooser and can add a new Google account, so it is the
363
+ * right fallback when {@code NoCredentialException} is raised. Same result shape (ID token).
364
+ */
365
+ private void requestSignInWithGoogleButton(final CapacitorAuthManager.AuthCallback<JSObject> callback) {
366
+ String resolvedServerClientId = (serverClientId != null && !serverClientId.isEmpty())
367
+ ? serverClientId
368
+ : clientId;
303
369
 
304
- @Override
305
- public void onError(GetCredentialException e) {
306
- handleSignInError(e, callback);
307
- }
308
- }
309
- );
370
+ if (resolvedServerClientId == null || resolvedServerClientId.isEmpty()) {
371
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
372
+ AuthErrorCodes.MISSING_CONFIGURATION,
373
+ "Google sign-in requires a serverClientId (your Web OAuth client id). "
374
+ + "Provide 'serverClientId' (or 'clientId') in the google provider options.")));
375
+ return;
376
+ }
377
+
378
+ if (activity == null) {
379
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
380
+ AuthErrorCodes.PROVIDER_NOT_INITIALIZED,
381
+ "Google sign-in requires a foreground Activity.")));
382
+ return;
383
+ }
384
+
385
+ try {
386
+ GetSignInWithGoogleOption.Builder optionBuilder = new GetSignInWithGoogleOption.Builder(resolvedServerClientId);
387
+ if (nonce != null && !nonce.isEmpty()) {
388
+ optionBuilder.setNonce(nonce);
389
+ }
390
+ if (hostedDomain != null && !hostedDomain.isEmpty()) {
391
+ optionBuilder.setHostedDomainFilter(hostedDomain);
392
+ }
393
+
394
+ GetCredentialRequest request = new GetCredentialRequest.Builder()
395
+ .addCredentialOption(optionBuilder.build())
396
+ .build();
397
+
398
+ launchCredentialRequest(request, callback);
310
399
  } catch (Exception e) {
311
- logger.error("Failed to start Google Credential Manager request", e);
312
- callback.onResult(CapacitorAuthManager.AuthResult.error(e));
400
+ logger.error("Failed to start the Sign in with Google button flow", e);
401
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
402
+ AuthErrorCodes.SIGN_IN_FAILED,
403
+ "Failed to start the Sign in with Google button flow: " + e.getMessage(), e)));
313
404
  }
314
405
  }
315
406
 
407
+ private void launchCredentialRequest(
408
+ GetCredentialRequest request,
409
+ final CapacitorAuthManager.AuthCallback<JSObject> callback
410
+ ) {
411
+ CredentialManager credentialManager = CredentialManager.create(context);
412
+ Executor executor = ContextCompat.getMainExecutor(context);
413
+
414
+ credentialManager.getCredentialAsync(
415
+ activity,
416
+ request,
417
+ null,
418
+ executor,
419
+ new CredentialManagerCallback<GetCredentialResponse, GetCredentialException>() {
420
+ @Override
421
+ public void onResult(GetCredentialResponse response) {
422
+ handleSignInResponse(response, callback);
423
+ }
424
+
425
+ @Override
426
+ public void onError(GetCredentialException e) {
427
+ handleSignInError(e, callback);
428
+ }
429
+ }
430
+ );
431
+ }
432
+
316
433
  private void handleSignInResponse(
317
434
  GetCredentialResponse response,
318
435
  CapacitorAuthManager.AuthCallback<JSObject> callback
@@ -351,14 +468,17 @@ public class GoogleAuthProvider implements BaseAuthProvider {
351
468
  } else {
352
469
  String type = credential != null ? credential.getType() : "null";
353
470
  logger.error("Unexpected credential type from Credential Manager: " + type, null);
354
- callback.onResult(CapacitorAuthManager.AuthResult.error(new IllegalStateException(
471
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
472
+ AuthErrorCodes.INVALID_CREDENTIALS,
355
473
  "Unexpected credential type returned from Google sign-in: " + type)));
356
474
  }
357
475
  } catch (Exception e) {
358
476
  // Covers a malformed credential / ID-token parse failure. (googleid 1.1.1's
359
477
  // GoogleIdTokenCredential.createFrom does not declare a checked exception.)
360
478
  logger.error("Unexpected error handling Google credential", e);
361
- callback.onResult(CapacitorAuthManager.AuthResult.error(e));
479
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
480
+ AuthErrorCodes.INVALID_CREDENTIALS,
481
+ "Could not read the Google credential: " + e.getMessage(), e)));
362
482
  }
363
483
  }
364
484
 
@@ -368,19 +488,29 @@ public class GoogleAuthProvider implements BaseAuthProvider {
368
488
  ) {
369
489
  if (e instanceof GetCredentialCancellationException) {
370
490
  logger.info("Google sign-in cancelled by user");
371
- callback.onResult(CapacitorAuthManager.AuthResult.error(new Exception("User cancelled Google sign-in")));
491
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
492
+ AuthErrorCodes.USER_CANCELLED, "User cancelled Google sign-in")));
493
+ return;
494
+ }
495
+ if (e instanceof GetCredentialInterruptedException) {
496
+ // Transient: Play services restarted or the device lost connectivity mid-request.
497
+ logger.warn("Google sign-in interrupted; the caller may retry");
498
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
499
+ AuthErrorCodes.NETWORK_ERROR,
500
+ "Google sign-in was interrupted. Check the connection and try again.")));
372
501
  return;
373
502
  }
374
503
  if (e instanceof NoCredentialException) {
375
504
  logger.warn("No Google credentials available for sign-in");
376
- callback.onResult(CapacitorAuthManager.AuthResult.error(new Exception(
505
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new NoGoogleCredentialException(
377
506
  "No Google account available. Add a Google account to the device, or ensure "
378
507
  + "Google Play services is up to date and the SHA-1 fingerprint is registered.")));
379
508
  return;
380
509
  }
381
510
  logger.error("Google sign-in failed: " + e.getClass().getSimpleName(), e);
382
- callback.onResult(CapacitorAuthManager.AuthResult.error(new Exception(
383
- "Google sign-in failed: " + e.getMessage())));
511
+ callback.onResult(CapacitorAuthManager.AuthResult.error(new AuthException(
512
+ AuthErrorCodes.SIGN_IN_FAILED,
513
+ "Google sign-in failed: " + e.getMessage(), e)));
384
514
  }
385
515
 
386
516
  private void clearCredentialState(final CapacitorAuthManager.AuthCallback<Void> callback) {
@@ -421,7 +551,7 @@ public class GoogleAuthProvider implements BaseAuthProvider {
421
551
  String displayName = cred.getDisplayName();
422
552
  Uri photoUri = cred.getProfilePictureUri();
423
553
  String photoURL = photoUri != null ? photoUri.toString() : null;
424
- String phoneNumber = cred.getPhoneNumber();
554
+ String phoneNumber = null; // Google ID tokens do not provide a phone number.
425
555
 
426
556
  String uid = null;
427
557
  boolean emailVerified = true;
@@ -496,7 +626,7 @@ public class GoogleAuthProvider implements BaseAuthProvider {
496
626
  private void persistSession(JSObject user, JSObject credential) {
497
627
  try {
498
628
  storage.saveCredential(STORAGE_CREDENTIAL_KEY, credential);
499
- storage.saveCredential(STORAGE_USER_KEY, user);
629
+ storage.saveUser(STORAGE_USER_KEY, user);
500
630
  } catch (Exception e) {
501
631
  logger.warn("Failed to persist Google session");
502
632
  }
@@ -505,7 +635,7 @@ public class GoogleAuthProvider implements BaseAuthProvider {
505
635
  private void clearSession() {
506
636
  currentUser = null;
507
637
  storage.deleteCredential(STORAGE_CREDENTIAL_KEY);
508
- storage.deleteCredential(STORAGE_USER_KEY);
638
+ storage.deleteUser(STORAGE_USER_KEY);
509
639
  }
510
640
 
511
641
  private void warnIfUnsupportedOptions() {
@@ -89,6 +89,11 @@ public class ProviderFactory {
89
89
  provider.setLoginHint(loginHint);
90
90
  }
91
91
 
92
+ String androidFlow = config.getString("androidFlow");
93
+ if (androidFlow != null) {
94
+ provider.setAndroidFlow(androidFlow);
95
+ }
96
+
92
97
  try {
93
98
  JSONArray scopesArray = config.getJSONArray("scopes");
94
99
  if (scopesArray != null) {