@@ -487,6 +487,7 @@ public void run() {
487487 identityManager .setConfiguration (awsConfiguration );
488488 identityManager .setPersistenceEnabled (mIsPersistenceEnabled );
489489 IdentityManager .setDefaultIdentityManager (identityManager );
490+ registerConfigSignInProviders (awsConfiguration );
490491 identityManager .addSignInStateChangeListener (new SignInStateChangeListener () {
491492 @ Override
492493 public void onUserSignedIn () {
@@ -3365,8 +3366,6 @@ public void run() {
33653366 return ;
33663367 }
33673368
3368- registerConfigSignInProviders ();
3369-
33703369 final AuthUIConfiguration .Builder authUIConfigBuilder = new AuthUIConfiguration .Builder ()
33713370 .canCancel (signInUIOptions .canCancel ())
33723371 .isBackgroundColorFullScreen (false );
@@ -3505,7 +3504,7 @@ private void fetchCognitoIdentity(final Context context,
35053504 final IdentityManager identityManager = new IdentityManager (context , this .awsConfiguration );
35063505 IdentityManager .setDefaultIdentityManager (identityManager );
35073506 if (this .signInProviderConfig == null ) {
3508- this .registerConfigSignInProviders ();
3507+ this .registerConfigSignInProviders (this . awsConfiguration );
35093508 } else {
35103509 this .registerUserSignInProvidersWithPermissions ();
35113510 }
@@ -3541,21 +3540,21 @@ private void registerUserSignInProvidersWithPermissions() {
35413540 * Register the SignInProvider and permissions based on the
35423541 * AWSConfiguration.
35433542 */
3544- private void registerConfigSignInProviders () {
3543+ private void registerConfigSignInProviders (final AWSConfiguration awsConfiguration ) {
35453544 Log .d (TAG , "Using the SignInProviderConfig from `awsconfiguration.json`." );
35463545 final IdentityManager identityManager = IdentityManager .getDefaultIdentityManager ();
35473546
3548- if (isConfigurationKeyPresent (USER_POOLS , this . awsConfiguration )
3547+ if (isConfigurationKeyPresent (USER_POOLS , awsConfiguration )
35493548 && !identityManager .getSignInProviderClasses ().contains (CognitoUserPoolsSignInProvider .class )) {
35503549 identityManager .addSignInProvider (CognitoUserPoolsSignInProvider .class );
35513550 }
35523551
3553- if (isConfigurationKeyPresent (FACEBOOK , this . awsConfiguration )
3552+ if (isConfigurationKeyPresent (FACEBOOK , awsConfiguration )
35543553 && !identityManager .getSignInProviderClasses ().contains (FacebookSignInProvider .class )) {
35553554 identityManager .addSignInProvider (FacebookSignInProvider .class );
35563555 }
35573556
3558- if (isConfigurationKeyPresent (GOOGLE , this . awsConfiguration )
3557+ if (isConfigurationKeyPresent (GOOGLE , awsConfiguration )
35593558 && !identityManager .getSignInProviderClasses ().contains (GoogleSignInProvider .class )) {
35603559 identityManager .addSignInProvider (GoogleSignInProvider .class );
35613560 }
0 commit comments