Search in sources :

Example 6 with AuthenticationDetails

use of com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails in project aws-sdk-android by aws-amplify.

the class CognitoIdentityProviderSignInUserTest method getSessionWithUserPasswordInCurrentThreadNoCachedTokensNoMFA.

// Authenticate user with user password auth in current thread
// Failing due to Mockito error
@Ignore
@Test
public void getSessionWithUserPasswordInCurrentThreadNoCachedTokensNoMFA() throws Exception {
    testUser = testPool.getUser(TEST_USER_NAME);
    assertNotNull(testUser.getUserId());
    // Test with a user cached in shared preferences, with no cached tokens
    awsKeyValueStorageUtility.put("CognitoIdentityProvider." + TEST_CLIENT_ID + ".LastAuthUser", TEST_USER_NAME);
    // Set mock returns for Authentication API Calls
    // API call to start forgot-password flow
    doReturn(TEST_VALID_INITIATE_USER_SRP_AUTH_RESPONSE).when(mockCSIClient).initiateAuth(any(InitiateAuthRequest.class));
    // Tracker to validate the callback sequence -> callback.getAuthenticationDetails() -> onSuccess()
    final FlowTracker tracker = new FlowTracker("getAuthenticationDetails");
    System.out.println("Get session");
    testUser.getSession(new AuthenticationHandler() {

        @Override
        public void onSuccess(CognitoUserSession session, CognitoDevice device) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("onSuccess"));
            // Extract the arguments passed to the initiateAuth API call
            ArgumentCaptor<InitiateAuthRequest> argumentCaptor = ArgumentCaptor.forClass(InitiateAuthRequest.class);
            verify(mockCSIClient).initiateAuth(argumentCaptor.capture());
            InitiateAuthRequest requestSent = argumentCaptor.getValue();
            // Verify the arguments passed in the API call
            assertNotNull(requestSent);
            assertEquals(TEST_CLIENT_ID, requestSent.getClientId());
            assertEquals("USER_PASSWORD_AUTH", requestSent.getAuthFlow());
            // Check authentication parameters - username and password.
            assertNotNull(requestSent.getAuthParameters().get("USERNAME"));
            assertNotNull(requestSent.getAuthParameters().get("PASSWORD"));
            // Verify if we have a valid session
            assertNotNull(session);
            assertTrue(session.isValid());
            // Verify that the device is null
            assertNull(device);
            tracker.setNext("end");
        }

        @Override
        public void getAuthenticationDetails(AuthenticationContinuation continuation, String username) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("getAuthenticationDetails"));
            // Check parameters
            assertNotNull(continuation);
            assertNotNull(continuation.getParameters());
            // Continue with authentication details
            Map<String, String> TEST_IN_VALIDATION_DATA = new HashMap<String, String>();
            TEST_IN_VALIDATION_DATA.put("DummyAttribute_1", "Value4DummyAttribute_1");
            TEST_IN_VALIDATION_DATA.put("DummyAttribute_2", "Value4DummyAttribute_2");
            AuthenticationDetails authDetails = new AuthenticationDetails(TEST_USER_NAME, TEST_USER_PASSWORD, TEST_IN_VALIDATION_DATA);
            authDetails.setAuthenticationType(TEST_USER_PASSWORD_AUTH_TYPE);
            tracker.setNext("onSuccess");
            continuation.setAuthenticationDetails(authDetails);
            // Set challenge response for valid
            doReturn(TEST_VALID_INITIATE_USER_PASSWORD_AUTH_RESPONSE).when(mockCSIClient).initiateAuth(any(InitiateAuthRequest.class));
            doReturn(TEST_VALID_SUCCESSFUL_AUTH_RESPONSE).when(mockCSIClient).respondToAuthChallenge(any(RespondToAuthChallengeRequest.class));
            continuation.continueTask();
        }

        @Override
        public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("getMFACode"));
        }

        @Override
        public void onFailure(Exception exception) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("onFailure"));
        }

        @Override
        public void authenticationChallenge(ChallengeContinuation continuation) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("authenticationChallenge"));
        }
    });
}
Also used : InitiateAuthRequest(com.amazonaws.services.cognitoidentityprovider.model.InitiateAuthRequest) ArgumentCaptor(org.mockito.ArgumentCaptor) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) FlowTracker(com.amazonaws.mobileconnectors.cognitoidentityprovider.utils.FlowTracker) CognitoUserSession(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession) HashMap(java.util.HashMap) Map(java.util.Map) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 7 with AuthenticationDetails

use of com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails in project aws-sdk-android by aws-amplify.

the class CognitoIdentityProviderSignInUserTest method getSessionWithUserPasswordInBackgroundThreadNoCachedTokensNoMFA.

// Authenticate user with user password auth in current thread
// Failing due to Mockito error
@Ignore
@Test
public void getSessionWithUserPasswordInBackgroundThreadNoCachedTokensNoMFA() throws Exception {
    testPool = new CognitoUserPool(appContext, TEST_USER_POOL, TEST_CLIENT_ID, TEST_CLIENT_SECRET, mockCSIClient);
    testUser = testPool.getUser(TEST_USER_NAME);
    assertNotNull(testUser.getUserId());
    // Test with a user cached in shared preferences, with no cached tokens
    awsKeyValueStorageUtility.put("CognitoIdentityProvider." + TEST_CLIENT_ID + ".LastAuthUser", TEST_USER_NAME);
    // Set mock returns for Authentication API Calls
    // API call to start forgot-password flow
    doReturn(TEST_VALID_INITIATE_USER_SRP_AUTH_RESPONSE).when(mockCSIClient).initiateAuth(any(InitiateAuthRequest.class));
    // Tracker to validate the callback sequence -> callback.getAuthenticationDetails() -> onSuccess()
    final FlowTracker tracker = new FlowTracker("getAuthenticationDetails");
    System.out.println("Get session");
    testUser.getSessionInBackground(new AuthenticationHandler() {

        @Override
        public void onSuccess(CognitoUserSession session, CognitoDevice device) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("onSuccess"));
            // Extract the arguments passed to the initiateAuth API call
            ArgumentCaptor<InitiateAuthRequest> argumentCaptor = ArgumentCaptor.forClass(InitiateAuthRequest.class);
            verify(mockCSIClient).initiateAuth(argumentCaptor.capture());
            InitiateAuthRequest requestSent = argumentCaptor.getValue();
            // Verify the arguments passed in the API call
            assertNotNull(requestSent);
            assertEquals(TEST_CLIENT_ID, requestSent.getClientId());
            assertEquals("USER_PASSWORD_AUTH", requestSent.getAuthFlow());
            // Check authentication parameters - username and password.
            assertNotNull(requestSent.getAuthParameters().get("USERNAME"));
            assertNotNull(requestSent.getAuthParameters().get("PASSWORD"));
            // Verify if we have a valid session
            assertNotNull(session);
            assertTrue(session.isValid());
            // Verify that the device is null
            assertNull(device);
            tracker.setNext("end");
        }

        @Override
        public void getAuthenticationDetails(AuthenticationContinuation continuation, String username) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("getAuthenticationDetails"));
            // Check parameters
            assertNotNull(continuation);
            assertNotNull(continuation.getParameters());
            // Continue with authentication details
            Map<String, String> TEST_IN_VALIDATION_DATA = new HashMap<String, String>();
            TEST_IN_VALIDATION_DATA.put("DummyAttribute_1", "Value4DummyAttribute_1");
            TEST_IN_VALIDATION_DATA.put("DummyAttribute_2", "Value4DummyAttribute_2");
            AuthenticationDetails authDetails = new AuthenticationDetails(TEST_USER_NAME, TEST_USER_PASSWORD, TEST_IN_VALIDATION_DATA);
            authDetails.setAuthenticationType(TEST_USER_PASSWORD_AUTH_TYPE);
            tracker.setNext("onSuccess");
            continuation.setAuthenticationDetails(authDetails);
            // Set challenge response for valid
            doReturn(TEST_VALID_INITIATE_USER_PASSWORD_AUTH_RESPONSE).when(mockCSIClient).initiateAuth(any(InitiateAuthRequest.class));
            doReturn(TEST_VALID_SUCCESSFUL_AUTH_RESPONSE).when(mockCSIClient).respondToAuthChallenge(any(RespondToAuthChallengeRequest.class));
            continuation.continueTask();
        }

        @Override
        public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("getMFACode"));
        }

        @Override
        public void onFailure(Exception exception) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("onFailure"));
        }

        @Override
        public void authenticationChallenge(ChallengeContinuation continuation) {
            // Check if this method was called out of sequence
            assertTrue(tracker.check("authenticationChallenge"));
        }
    });
}
Also used : InitiateAuthRequest(com.amazonaws.services.cognitoidentityprovider.model.InitiateAuthRequest) CognitoUserPool(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool) ArgumentCaptor(org.mockito.ArgumentCaptor) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) FlowTracker(com.amazonaws.mobileconnectors.cognitoidentityprovider.utils.FlowTracker) CognitoUserSession(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession) HashMap(java.util.HashMap) Map(java.util.Map) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 8 with AuthenticationDetails

use of com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails in project aws-sdk-android by aws-amplify.

the class CognitoUserPoolsIntegrationTestBase method signIn.

CognitoUserSession signIn() {
    final CountDownLatch signInLatch = new CountDownLatch(1);
    final ArrayList<CognitoUserSession> listSessions = new ArrayList<CognitoUserSession>();
    cognitoUserPool.getUser(userName).getSession(new AuthenticationHandler() {

        @Override
        public void onSuccess(CognitoUserSession userSession, CognitoDevice newDevice) {
            listSessions.add(userSession);
            signInLatch.countDown();
        }

        @Override
        public void getAuthenticationDetails(AuthenticationContinuation authenticationContinuation, String userId) {
            AuthenticationDetails authenticationDetails = new AuthenticationDetails(userName, password, null);
            authenticationContinuation.setAuthenticationDetails(authenticationDetails);
            authenticationContinuation.continueTask();
        }

        @Override
        public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
            fail("Tests are not configured to work with MFA. " + "Either create a CognitoUserPool without MFA or update the test.");
            signInLatch.countDown();
        }

        @Override
        public void authenticationChallenge(ChallengeContinuation continuation) {
            fail("Tests are not configured to work with additional challenges. " + "Either create a CognitoUserPool without additional challenges or update the test.");
            signInLatch.countDown();
        }

        @Override
        public void onFailure(Exception exception) {
            fail("Error while signing-in. " + exception.getLocalizedMessage());
            signInLatch.countDown();
        }
    });
    try {
        signInLatch.await(TIMEOUT_IN_SECONDS, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    assertEquals(1, listSessions.size());
    return listSessions.get(0);
}
Also used : ArrayList(java.util.ArrayList) CountDownLatch(java.util.concurrent.CountDownLatch) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails)

Example 9 with AuthenticationDetails

use of com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails in project aws-sdk-android by aws-amplify.

the class OAuth2Utils method _signIn.

private Runnable _signIn(final String username, final String password, final Map<String, String> validationData, final Map<String, String> clientMetadata, final Callback<SignInResult> callback) {
    this.signInCallback = callback;
    signInState = null;
    mStore.set(SIGN_IN_MODE, SignInMode.SIGN_IN.toString());
    return new Runnable() {

        @Override
        public void run() {
            try {
                userpool.getUser(username).getSession(clientMetadata, new AuthenticationHandler() {

                    @Override
                    public void onSuccess(CognitoUserSession userSession, CognitoDevice newDevice) {
                        try {
                            mCognitoUserSession = userSession;
                            signInState = SignInState.DONE;
                        } catch (Exception e) {
                            signInCallback.onError(e);
                            signInCallback = null;
                        }
                        try {
                            if (isFederationEnabled()) {
                                federatedSignInWithoutAssigningState(userpoolsLoginKey, mCognitoUserSession.getIdToken().getJWTToken());
                            }
                            releaseSignInWait();
                        } catch (Exception e) {
                            Log.w(TAG, "Failed to federate tokens during sign-in", e);
                        } finally {
                            setUserState(new UserStateDetails(UserState.SIGNED_IN, getSignInDetailsMap()));
                        }
                        signInCallback.onResult(SignInResult.DONE);
                    }

                    @Override
                    public void getAuthenticationDetails(AuthenticationContinuation authenticationContinuation, String userId) {
                        Log.d(TAG, "Sending password.");
                        final HashMap<String, String> authParameters = new HashMap<>();
                        // Check if the auth flow type setting is in the configuration.
                        boolean authFlowTypeInConfig = awsConfiguration.optJsonObject(AUTH_KEY) != null && awsConfiguration.optJsonObject(AUTH_KEY).has("authenticationFlowType");
                        try {
                            String authFlowType = authFlowTypeInConfig ? awsConfiguration.optJsonObject(AUTH_KEY).getString("authenticationFlowType") : null;
                            if (authFlowTypeInConfig && AUTH_TYPE_INIT_CUSTOM_AUTH.equals(authFlowType)) {
                                // use one of the below constructors depending on what's passed in.
                                if (password != null) {
                                    authenticationContinuation.setAuthenticationDetails(new AuthenticationDetails(username, password, authParameters, validationData));
                                } else {
                                    authenticationContinuation.setAuthenticationDetails(new AuthenticationDetails(username, authParameters, validationData));
                                }
                            } else if (authFlowTypeInConfig && AUTH_TYPE_INIT_USER_PASSWORD.equals(authFlowType)) {
                                // If there's a value in the config and it's USER_PASSWORD_AUTH, set the auth type (challenge name)
                                // to be USER_PASSWORD.
                                AuthenticationDetails authenticationDetails = new AuthenticationDetails(username, password, validationData);
                                authenticationDetails.setAuthenticationType(CHLG_TYPE_USER_PASSWORD);
                                authenticationContinuation.setAuthenticationDetails(authenticationDetails);
                            } else {
                                // Otherwise, auth flow is USER_SRP_AUTH and the auth type (challenge name)
                                // will default to PASSWORD_VERIFIER.
                                Log.d(TAG, "Using USER_SRP_AUTH for flow type.");
                                authenticationContinuation.setAuthenticationDetails(new AuthenticationDetails(username, password, validationData));
                            }
                        } catch (JSONException exception) {
                            Log.w(TAG, "Exception while attempting to read authenticationFlowType from config.", exception);
                        }
                        authenticationContinuation.continueTask();
                    }

                    @Override
                    public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
                        signInMfaContinuation = continuation;
                        CognitoUserCodeDeliveryDetails parameters = continuation.getParameters();
                        signInState = SignInState.SMS_MFA;
                        signInCallback.onResult(new SignInResult(SignInState.SMS_MFA, new UserCodeDeliveryDetails(parameters.getDestination(), parameters.getDeliveryMedium(), parameters.getAttributeName())));
                    }

                    @Override
                    public void authenticationChallenge(ChallengeContinuation continuation) {
                        try {
                            signInState = SignInState.valueOf(continuation.getChallengeName());
                            signInChallengeContinuation = continuation;
                            signInCallback.onResult(new SignInResult(signInState, continuation.getParameters()));
                        } catch (IllegalArgumentException e) {
                            signInCallback.onError(e);
                        }
                    }

                    @Override
                    public void onFailure(Exception exception) {
                        signInCallback.onError(exception);
                    }
                });
            } catch (Exception e) {
                callback.onError(e);
            }
        }
    };
}
Also used : LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) CognitoUserCodeDeliveryDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserCodeDeliveryDetails) UserCodeDeliveryDetails(com.amazonaws.mobile.client.results.UserCodeDeliveryDetails) JSONException(org.json.JSONException) JSONException(org.json.JSONException) InvalidUserPoolConfigurationException(com.amazonaws.services.cognitoidentityprovider.model.InvalidUserPoolConfigurationException) AmazonClientException(com.amazonaws.AmazonClientException) NotAuthorizedException(com.amazonaws.services.cognitoidentity.model.NotAuthorizedException) SignInResult(com.amazonaws.mobile.client.results.SignInResult) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) CognitoUserCodeDeliveryDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserCodeDeliveryDetails) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) ReturningRunnable(com.amazonaws.mobile.client.internal.ReturningRunnable) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) CognitoUserSession(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails)

Example 10 with AuthenticationDetails

use of com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails in project aws-mobile-appsync-sdk-android by awslabs.

the class CustomCognitoUserPool method setup.

@NonNull
public static String setup() {
    // Sign in the user.
    Await.result((Await.ResultErrorEmitter<SignInResult, RuntimeException>) (onResult, onError) -> {
        DelegatingMobileClientCallback<SignInResult> callback = DelegatingMobileClientCallback.to(onResult, exception -> onError.accept(new RuntimeException(exception)));
        TestAWSMobileClient.instance(getTargetContext()).signIn("appsync-multi-auth-test-user", "P@ssw0rd!", null, callback);
    });
    // Build a custom cognito user pool.
    AWSConfiguration awsConfiguration = new AWSConfiguration(getTargetContext());
    awsConfiguration.setConfiguration("Custom");
    CognitoUserPool cognitoUserPool = new CognitoUserPool(getTargetContext(), awsConfiguration);
    // Get the ID token for this user.
    return Await.result((onResult, onError) -> cognitoUserPool.getUser("appsync-multi-auth-test-user").getSession(new AuthenticationHandler() {

        @Override
        public void onSuccess(CognitoUserSession userSession, CognitoDevice newDevice) {
            onResult.accept(userSession.getIdToken().getJWTToken());
        }

        @Override
        public void getAuthenticationDetails(AuthenticationContinuation authenticationContinuation, String userId) {
            Log.d(TAG, "Sending password.");
            authenticationContinuation.setAuthenticationDetails(new AuthenticationDetails("appsync-multi-auth-test-user", "P@ssw0rd!", null));
            authenticationContinuation.continueTask();
        }

        @Override
        public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
        }

        @Override
        public void authenticationChallenge(ChallengeContinuation continuation) {
        }

        @Override
        public void onFailure(Exception exception) {
            onError.accept(new RuntimeException(exception));
        }
    }));
}
Also used : InstrumentationRegistry.getTargetContext(androidx.test.InstrumentationRegistry.getTargetContext) NonNull(androidx.annotation.NonNull) CognitoUserSession(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession) SignInResult(com.amazonaws.mobile.client.results.SignInResult) Await(com.amazonaws.mobileconnectors.appsync.util.Await) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) AWSConfiguration(com.amazonaws.mobile.config.AWSConfiguration) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) CognitoUserPool(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) Log(android.util.Log) CognitoUserPool(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool) CognitoDevice(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice) AWSConfiguration(com.amazonaws.mobile.config.AWSConfiguration) SignInResult(com.amazonaws.mobile.client.results.SignInResult) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) AuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation) MultiFactorAuthenticationContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation) ChallengeContinuation(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation) AuthenticationHandler(com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler) CognitoUserSession(com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession) Await(com.amazonaws.mobileconnectors.appsync.util.Await) AuthenticationDetails(com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails) NonNull(androidx.annotation.NonNull)

Aggregations

AuthenticationContinuation (com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation)10 AuthenticationDetails (com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationDetails)10 ChallengeContinuation (com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation)9 MultiFactorAuthenticationContinuation (com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation)9 AuthenticationHandler (com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler)9 CognitoDevice (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice)7 CognitoUserSession (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession)7 HashMap (java.util.HashMap)7 Test (org.junit.Test)5 FlowTracker (com.amazonaws.mobileconnectors.cognitoidentityprovider.utils.FlowTracker)4 InitiateAuthRequest (com.amazonaws.services.cognitoidentityprovider.model.InitiateAuthRequest)4 Map (java.util.Map)4 Ignore (org.junit.Ignore)4 ArgumentCaptor (org.mockito.ArgumentCaptor)4 SignInResult (com.amazonaws.mobile.client.results.SignInResult)3 CognitoUserPool (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool)3 AmazonClientException (com.amazonaws.AmazonClientException)2 ReturningRunnable (com.amazonaws.mobile.client.internal.ReturningRunnable)2 UserCodeDeliveryDetails (com.amazonaws.mobile.client.results.UserCodeDeliveryDetails)2 CognitoUserCodeDeliveryDetails (com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserCodeDeliveryDetails)2