Search in sources :

Example 26 with AuthException

use of com.amplifyframework.auth.AuthException in project amplify-android by aws-amplify.

the class AWSCognitoAuthPlugin method updateUserAttributes.

@Override
public void updateUserAttributes(@NonNull List<AuthUserAttribute> attributes, @NonNull AuthUpdateUserAttributesOptions options, @NonNull Consumer<Map<AuthUserAttributeKey, AuthUpdateAttributeResult>> onSuccess, @NonNull Consumer<AuthException> onError) {
    final Map<String, String> clientMetadata = new HashMap<>();
    if (options instanceof AWSCognitoAuthUpdateUserAttributesOptions) {
        AWSCognitoAuthUpdateUserAttributesOptions cognitoOptions = (AWSCognitoAuthUpdateUserAttributesOptions) options;
        clientMetadata.putAll(cognitoOptions.getMetadata());
    }
    Map<String, String> attributesMap = new HashMap<>();
    for (AuthUserAttribute attribute : attributes) {
        attributesMap.put(attribute.getKey().getKeyString(), attribute.getValue());
    }
    awsMobileClient.updateUserAttributes(attributesMap, clientMetadata, new Callback<List<UserCodeDeliveryDetails>>() {

        @Override
        public void onResult(List<UserCodeDeliveryDetails> result) {
            Map<String, UserCodeDeliveryDetails> codeDetailsMap = new HashMap<>();
            Map<AuthUserAttributeKey, AuthUpdateAttributeResult> resultMap = new HashMap<>();
            for (UserCodeDeliveryDetails details : result) {
                codeDetailsMap.put(details.getAttributeName(), details);
            }
            for (String attributeKey : attributesMap.keySet()) {
                if (codeDetailsMap.containsKey(attributeKey)) {
                    resultMap.put(AuthUserAttributeKey.custom(attributeKey), new AuthUpdateAttributeResult(true, new AuthNextUpdateAttributeStep(AuthUpdateAttributeStep.CONFIRM_ATTRIBUTE_WITH_CODE, Collections.emptyMap(), convertCodeDeliveryDetails(codeDetailsMap.get(attributeKey)))));
                } else {
                    resultMap.put(AuthUserAttributeKey.custom(attributeKey), new AuthUpdateAttributeResult(true, new AuthNextUpdateAttributeStep(AuthUpdateAttributeStep.DONE, Collections.emptyMap(), null)));
                }
            }
            onSuccess.accept(resultMap);
        }

        @Override
        public void onError(Exception error) {
            onError.accept(new AuthException("Failed to update user attributes", error, "See attached exception for more details"));
        }
    });
}
Also used : AuthUserAttribute(com.amplifyframework.auth.AuthUserAttribute) AuthUpdateAttributeResult(com.amplifyframework.auth.result.AuthUpdateAttributeResult) AuthNextUpdateAttributeStep(com.amplifyframework.auth.result.step.AuthNextUpdateAttributeStep) HashMap(java.util.HashMap) UserCodeDeliveryDetails(com.amazonaws.mobile.client.results.UserCodeDeliveryDetails) AuthException(com.amplifyframework.auth.AuthException) AuthException(com.amplifyframework.auth.AuthException) JSONException(org.json.JSONException) AmplifyException(com.amplifyframework.AmplifyException) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) AWSCognitoAuthUpdateUserAttributesOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthUpdateUserAttributesOptions) ArrayList(java.util.ArrayList) List(java.util.List) Map(java.util.Map) HashMap(java.util.HashMap)

Example 27 with AuthException

use of com.amplifyframework.auth.AuthException in project amplify-android by aws-amplify.

the class AWSCognitoAuthPlugin method configure.

@Override
public void configure(@NonNull JSONObject pluginConfiguration, @NonNull Context context) throws AuthException {
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicReference<Exception> asyncException = new AtomicReference<>();
    JSONObject mobileClientConfig;
    LogFactory.setLevel(LogFactory.Level.OFF);
    try {
        mobileClientConfig = new JSONObject(pluginConfiguration.toString());
        mobileClientConfig.put("UserAgentOverride", UserAgent.string());
    } catch (JSONException exception) {
        throw new AuthException("Failed to set user agent string", exception, AmplifyException.REPORT_BUG_TO_AWS_SUGGESTION);
    }
    awsMobileClient.initialize(context, new AWSConfiguration(mobileClientConfig), new Callback<UserStateDetails>() {

        @Override
        public void onResult(UserStateDetails result) {
            switch(result.getUserState()) {
                case GUEST:
                case SIGNED_OUT:
                    lastEvent = AuthChannelEventName.SIGNED_OUT;
                    userId = null;
                    break;
                case SIGNED_IN:
                    lastEvent = AuthChannelEventName.SIGNED_IN;
                    userId = getUserIdFromToken(result.getDetails().get(MOBILE_CLIENT_TOKEN_KEY));
                    break;
                case SIGNED_OUT_USER_POOLS_TOKENS_INVALID:
                case SIGNED_OUT_FEDERATED_TOKENS_INVALID:
                    lastEvent = AuthChannelEventName.SESSION_EXPIRED;
                    userId = getUserIdFromToken(result.getDetails().get(MOBILE_CLIENT_TOKEN_KEY));
                    break;
                default:
                    userId = null;
                    lastEvent = null;
            }
            // Set up a listener to asynchronously update the user id if the user state changes in the future
            awsMobileClient.addUserStateListener(userStateDetails -> {
                switch(userStateDetails.getUserState()) {
                    case SIGNED_OUT:
                    case GUEST:
                        userId = null;
                        if (lastEvent != AuthChannelEventName.SIGNED_OUT) {
                            lastEvent = AuthChannelEventName.SIGNED_OUT;
                            Amplify.Hub.publish(HubChannel.AUTH, HubEvent.create(AuthChannelEventName.SIGNED_OUT));
                        }
                        break;
                    case SIGNED_IN:
                        fetchAndSetUserId(() -> {
                            if (lastEvent != AuthChannelEventName.SIGNED_IN) {
                                lastEvent = AuthChannelEventName.SIGNED_IN;
                                Amplify.Hub.publish(HubChannel.AUTH, HubEvent.create(AuthChannelEventName.SIGNED_IN));
                            }
                        });
                        break;
                    case SIGNED_OUT_FEDERATED_TOKENS_INVALID:
                    case SIGNED_OUT_USER_POOLS_TOKENS_INVALID:
                        fetchAndSetUserId(() -> {
                        /* No response needed */
                        });
                        if (lastEvent != AuthChannelEventName.SESSION_EXPIRED) {
                            lastEvent = AuthChannelEventName.SESSION_EXPIRED;
                            Amplify.Hub.publish(HubChannel.AUTH, HubEvent.create(AuthChannelEventName.SESSION_EXPIRED));
                        }
                        break;
                    default:
                        userId = null;
                }
            });
            latch.countDown();
        }

        @Override
        public void onError(Exception error) {
            asyncException.set(error);
            latch.countDown();
        }
    });
    try {
        if (latch.await(SECONDS_BEFORE_TIMEOUT, TimeUnit.SECONDS)) {
            if (asyncException.get() != null) {
                throw new AuthException("Failed to instantiate AWSMobileClient", asyncException.get(), "See attached exception for more details");
            }
            return;
        } else {
            throw new AuthException("Failed to instantiate AWSMobileClient within " + SECONDS_BEFORE_TIMEOUT + " seconds", "Check network connectivity");
        }
    } catch (InterruptedException error) {
        throw new AuthException("Failed to instantiate AWSMobileClient", error, "See attached exception for more details");
    }
}
Also used : NonNull(androidx.annotation.NonNull) AuthException(com.amplifyframework.auth.AuthException) AuthProvider(com.amplifyframework.auth.AuthProvider) UserStateDetails(com.amazonaws.mobile.client.UserStateDetails) AWSCognitoAuthConfirmResetPasswordOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthConfirmResetPasswordOptions) AuthConfirmResetPasswordOptions(com.amplifyframework.auth.options.AuthConfirmResetPasswordOptions) AuthSignUpOptions(com.amplifyframework.auth.options.AuthSignUpOptions) JSONException(org.json.JSONException) AuthDevice(com.amplifyframework.auth.AuthDevice) AuthNextUpdateAttributeStep(com.amplifyframework.auth.result.step.AuthNextUpdateAttributeStep) AuthClient(com.amazonaws.mobileconnectors.cognitoauth.AuthClient) Map(java.util.Map) AuthPlugin(com.amplifyframework.auth.AuthPlugin) HubEvent(com.amplifyframework.hub.HubEvent) AuthCodeDeliveryDetails(com.amplifyframework.auth.AuthCodeDeliveryDetails) AuthResendSignUpCodeOptions(com.amplifyframework.auth.options.AuthResendSignUpCodeOptions) AuthNextSignInStep(com.amplifyframework.auth.result.step.AuthNextSignInStep) AuthConfirmSignUpOptions(com.amplifyframework.auth.options.AuthConfirmSignUpOptions) AuthResetPasswordOptions(com.amplifyframework.auth.options.AuthResetPasswordOptions) AuthUpdateAttributeStep(com.amplifyframework.auth.result.step.AuthUpdateAttributeStep) CountDownLatch(java.util.concurrent.CountDownLatch) Nullable(androidx.annotation.Nullable) AuthResetPasswordResult(com.amplifyframework.auth.result.AuthResetPasswordResult) AuthNextResetPasswordStep(com.amplifyframework.auth.result.step.AuthNextResetPasswordStep) SignInUIOptions(com.amazonaws.mobile.client.SignInUIOptions) UserState(com.amazonaws.mobile.client.UserState) AuthSignInOptions(com.amplifyframework.auth.options.AuthSignInOptions) AuthChannelEventName(com.amplifyframework.auth.AuthChannelEventName) AuthUserAttributeKey(com.amplifyframework.auth.AuthUserAttributeKey) AuthSignUpResult(com.amplifyframework.auth.result.AuthSignUpResult) AuthSession(com.amplifyframework.auth.AuthSession) Device(com.amazonaws.mobile.client.results.Device) ArrayList(java.util.ArrayList) SignUpResult(com.amazonaws.mobile.client.results.SignUpResult) AuthSessionResult(com.amplifyframework.auth.result.AuthSessionResult) AuthProviderConverter(com.amplifyframework.auth.cognito.util.AuthProviderConverter) AWSCognitoAuthConfirmSignUpOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthConfirmSignUpOptions) AuthWebUISignInOptions(com.amplifyframework.auth.options.AuthWebUISignInOptions) Tokens(com.amazonaws.mobile.client.results.Tokens) Action(com.amplifyframework.core.Action) AWSMobileClient(com.amazonaws.mobile.client.AWSMobileClient) SignInState(com.amazonaws.mobile.client.results.SignInState) AuthUserAttribute(com.amplifyframework.auth.AuthUserAttribute) AWSCognitoAuthUpdateUserAttributeOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthUpdateUserAttributeOptions) AuthSignUpStep(com.amplifyframework.auth.result.step.AuthSignUpStep) AmplifyException(com.amplifyframework.AmplifyException) SignOutOptions(com.amazonaws.mobile.client.SignOutOptions) AuthSignOutOptions(com.amplifyframework.auth.options.AuthSignOutOptions) UserAgent(com.amplifyframework.util.UserAgent) AuthResetPasswordStep(com.amplifyframework.auth.result.step.AuthResetPasswordStep) AWSConfiguration(com.amazonaws.mobile.config.AWSConfiguration) JSONObject(org.json.JSONObject) AuthResendUserAttributeConfirmationCodeOptions(com.amplifyframework.auth.options.AuthResendUserAttributeConfirmationCodeOptions) SignInStateConverter(com.amplifyframework.auth.cognito.util.SignInStateConverter) AuthUser(com.amplifyframework.auth.AuthUser) AuthSignInStep(com.amplifyframework.auth.result.step.AuthSignInStep) HubChannel(com.amplifyframework.hub.HubChannel) AWSCognitoAuthWebUISignInOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthWebUISignInOptions) SignInResult(com.amazonaws.mobile.client.results.SignInResult) Objects(java.util.Objects) ListDevicesResult(com.amazonaws.mobile.client.results.ListDevicesResult) List(java.util.List) Callback(com.amazonaws.mobile.client.Callback) CognitoJWTParser(com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoJWTParser) AWSCognitoAuthResetPasswordOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthResetPasswordOptions) AuthUpdateUserAttributesOptions(com.amplifyframework.auth.options.AuthUpdateUserAttributesOptions) UserCodeDeliveryDetails(com.amazonaws.mobile.client.results.UserCodeDeliveryDetails) AuthNextSignUpStep(com.amplifyframework.auth.result.step.AuthNextSignUpStep) AWSCognitoAuthSignInOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthSignInOptions) LogFactory(com.amazonaws.logging.LogFactory) Context(android.content.Context) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthUpdateUserAttributeOptions(com.amplifyframework.auth.options.AuthUpdateUserAttributeOptions) HostedUIOptions(com.amazonaws.mobile.client.HostedUIOptions) AWSCognitoAuthResendSignUpCodeOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthResendSignUpCodeOptions) Intent(android.content.Intent) HashMap(java.util.HashMap) ForgotPasswordResult(com.amazonaws.mobile.client.results.ForgotPasswordResult) AtomicReference(java.util.concurrent.atomic.AtomicReference) ForgotPasswordState(com.amazonaws.mobile.client.results.ForgotPasswordState) AWSCognitoAuthConfirmSignInOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthConfirmSignInOptions) Consumer(com.amplifyframework.core.Consumer) AuthSignInResult(com.amplifyframework.auth.result.AuthSignInResult) CognitoAuthExceptionConverter(com.amplifyframework.auth.cognito.util.CognitoAuthExceptionConverter) AuthUpdateAttributeResult(com.amplifyframework.auth.result.AuthUpdateAttributeResult) AWSCognitoAuthUpdateUserAttributesOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthUpdateUserAttributesOptions) Amplify(com.amplifyframework.core.Amplify) AuthFlowType(com.amplifyframework.auth.cognito.options.AuthFlowType) AuthConfirmSignInOptions(com.amplifyframework.auth.options.AuthConfirmSignInOptions) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) TimeUnit(java.util.concurrent.TimeUnit) AWSCognitoAuthResendUserAttributeConfirmationCodeOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthResendUserAttributeConfirmationCodeOptions) AWSCognitoAuthSignOutOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthSignOutOptions) Activity(android.app.Activity) VisibleForTesting(androidx.annotation.VisibleForTesting) AWSCognitoAuthSignUpOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthSignUpOptions) Collections(java.util.Collections) JSONException(org.json.JSONException) AuthException(com.amplifyframework.auth.AuthException) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) AWSConfiguration(com.amazonaws.mobile.config.AWSConfiguration) UserStateDetails(com.amazonaws.mobile.client.UserStateDetails) AuthException(com.amplifyframework.auth.AuthException) JSONException(org.json.JSONException) AmplifyException(com.amplifyframework.AmplifyException) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) JSONObject(org.json.JSONObject)

Example 28 with AuthException

use of com.amplifyframework.auth.AuthException in project amplify-android by aws-amplify.

the class AWSCognitoAuthPlugin method confirmSignUp.

@Override
public void confirmSignUp(@NonNull String username, @NonNull String confirmationCode, @NonNull AuthConfirmSignUpOptions options, @NonNull final Consumer<AuthSignUpResult> onSuccess, @NonNull final Consumer<AuthException> onException) {
    final Map<String, String> clientMetadata = new HashMap<>();
    if (options instanceof AWSCognitoAuthConfirmSignUpOptions) {
        AWSCognitoAuthConfirmSignUpOptions cognitoOptions = (AWSCognitoAuthConfirmSignUpOptions) options;
        clientMetadata.putAll(cognitoOptions.getClientMetadata());
    }
    awsMobileClient.confirmSignUp(username, confirmationCode, clientMetadata, new Callback<SignUpResult>() {

        @Override
        public void onResult(SignUpResult result) {
            onSuccess.accept(convertSignUpResult(result, username));
        }

        @Override
        public void onError(Exception error) {
            onException.accept(CognitoAuthExceptionConverter.lookup(error, "Confirm sign up failed"));
        }
    });
}
Also used : AWSCognitoAuthConfirmSignUpOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthConfirmSignUpOptions) HashMap(java.util.HashMap) AuthException(com.amplifyframework.auth.AuthException) JSONException(org.json.JSONException) AmplifyException(com.amplifyframework.AmplifyException) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) AuthSignUpResult(com.amplifyframework.auth.result.AuthSignUpResult) SignUpResult(com.amazonaws.mobile.client.results.SignUpResult)

Example 29 with AuthException

use of com.amplifyframework.auth.AuthException in project amplify-android by aws-amplify.

the class AWSCognitoAuthPlugin method signInWithWebUIHelper.

private void signInWithWebUIHelper(@Nullable AuthProvider authProvider, @NonNull Activity callingActivity, @NonNull AuthWebUISignInOptions options, @NonNull Consumer<AuthSignInResult> onSuccess, @NonNull Consumer<AuthException> onException) {
    HostedUIOptions.Builder optionsBuilder = HostedUIOptions.builder();
    SignInUIOptions.Builder signInUIOptionsBuilder = SignInUIOptions.builder();
    if (options != null) {
        if (options.getScopes() != null) {
            optionsBuilder.scopes(options.getScopes().toArray(new String[options.getScopes().size()]));
        }
        if (!options.getSignInQueryParameters().isEmpty()) {
            optionsBuilder.signInQueryParameters(options.getSignInQueryParameters());
        }
        if (!options.getSignOutQueryParameters().isEmpty()) {
            optionsBuilder.signOutQueryParameters(options.getSignOutQueryParameters());
        }
        if (!options.getTokenQueryParameters().isEmpty()) {
            optionsBuilder.tokenQueryParameters(options.getTokenQueryParameters());
        }
        if (options instanceof AWSCognitoAuthWebUISignInOptions) {
            AWSCognitoAuthWebUISignInOptions cognitoOptions = (AWSCognitoAuthWebUISignInOptions) options;
            optionsBuilder.idpIdentifier(cognitoOptions.getIdpIdentifier()).federationProviderName(cognitoOptions.getFederationProviderName());
            signInUIOptionsBuilder.browserPackage(cognitoOptions.getBrowserPackage());
        }
        if (authProvider != null) {
            optionsBuilder.identityProvider(AuthProviderConverter.getIdentityProvider(authProvider));
        }
    }
    SignInUIOptions signInUIOptions = signInUIOptionsBuilder.hostedUIOptions(optionsBuilder.build()).build();
    awsMobileClient.showSignIn(callingActivity, signInUIOptions, new Callback<UserStateDetails>() {

        @Override
        public void onResult(UserStateDetails details) {
            fetchAndSetUserId(() -> onSuccess.accept(new AuthSignInResult(UserState.SIGNED_IN.equals(details.getUserState()), new AuthNextSignInStep(AuthSignInStep.DONE, details.getDetails(), null))));
        }

        @Override
        public void onError(Exception error) {
            if (error instanceof AuthNavigationException) {
                onException.accept(new AuthException.UserCancelledException("The user cancelled the sign-in attempt, so it did not complete.", error, "To recover: catch this error, and show the sign-in screen again."));
            } else {
                onException.accept(new AuthException("Sign-in with web UI failed", error, "See attached exception for more details"));
            }
        }
    });
}
Also used : AuthException(com.amplifyframework.auth.AuthException) AuthNextSignInStep(com.amplifyframework.auth.result.step.AuthNextSignInStep) UserStateDetails(com.amazonaws.mobile.client.UserStateDetails) AuthException(com.amplifyframework.auth.AuthException) JSONException(org.json.JSONException) AmplifyException(com.amplifyframework.AmplifyException) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) HostedUIOptions(com.amazonaws.mobile.client.HostedUIOptions) SignInUIOptions(com.amazonaws.mobile.client.SignInUIOptions) AWSCognitoAuthWebUISignInOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthWebUISignInOptions) AuthSignInResult(com.amplifyframework.auth.result.AuthSignInResult)

Example 30 with AuthException

use of com.amplifyframework.auth.AuthException in project amplify-android by aws-amplify.

the class AWSCognitoAuthPlugin method updateUserAttribute.

@Override
public void updateUserAttribute(@NonNull AuthUserAttribute attribute, @NonNull AuthUpdateUserAttributeOptions options, @NonNull Consumer<AuthUpdateAttributeResult> onSuccess, @NonNull Consumer<AuthException> onError) {
    final Map<String, String> clientMetadata = new HashMap<>();
    if (options instanceof AWSCognitoAuthUpdateUserAttributeOptions) {
        AWSCognitoAuthUpdateUserAttributeOptions cognitoOptions = (AWSCognitoAuthUpdateUserAttributeOptions) options;
        clientMetadata.putAll(cognitoOptions.getMetadata());
    }
    awsMobileClient.updateUserAttributes(Collections.singletonMap(attribute.getKey().getKeyString(), attribute.getValue()), clientMetadata, new Callback<List<UserCodeDeliveryDetails>>() {

        @Override
        public void onResult(List<UserCodeDeliveryDetails> result) {
            if (result.size() == 0) {
                onSuccess.accept(new AuthUpdateAttributeResult(true, new AuthNextUpdateAttributeStep(AuthUpdateAttributeStep.DONE, Collections.emptyMap(), null)));
            } else {
                onSuccess.accept(new AuthUpdateAttributeResult(true, new AuthNextUpdateAttributeStep(AuthUpdateAttributeStep.CONFIRM_ATTRIBUTE_WITH_CODE, Collections.emptyMap(), convertCodeDeliveryDetails(result.get(0)))));
            }
        }

        @Override
        public void onError(Exception error) {
            onError.accept(new AuthException("Failed to update user attributes", error, "See attached exception for more details"));
        }
    });
}
Also used : AuthUpdateAttributeResult(com.amplifyframework.auth.result.AuthUpdateAttributeResult) AuthNextUpdateAttributeStep(com.amplifyframework.auth.result.step.AuthNextUpdateAttributeStep) HashMap(java.util.HashMap) UserCodeDeliveryDetails(com.amazonaws.mobile.client.results.UserCodeDeliveryDetails) AuthException(com.amplifyframework.auth.AuthException) AuthException(com.amplifyframework.auth.AuthException) JSONException(org.json.JSONException) AmplifyException(com.amplifyframework.AmplifyException) NotAuthorizedException(com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException) AuthNavigationException(com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException) ArrayList(java.util.ArrayList) List(java.util.List) AWSCognitoAuthUpdateUserAttributeOptions(com.amplifyframework.auth.cognito.options.AWSCognitoAuthUpdateUserAttributeOptions)

Aggregations

AuthException (com.amplifyframework.auth.AuthException)30 AmplifyException (com.amplifyframework.AmplifyException)18 JSONException (org.json.JSONException)18 Test (org.junit.Test)17 AuthNavigationException (com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthNavigationException)13 NotAuthorizedException (com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException)13 HashMap (java.util.HashMap)11 AuthSignInResult (com.amplifyframework.auth.result.AuthSignInResult)8 RandomString (com.amplifyframework.testutils.random.RandomString)7 AuthSignUpResult (com.amplifyframework.auth.result.AuthSignUpResult)6 UserStateDetails (com.amazonaws.mobile.client.UserStateDetails)5 AmazonClientException (com.amazonaws.AmazonClientException)4 SignUpResult (com.amazonaws.mobile.client.results.SignUpResult)4 UserCodeDeliveryDetails (com.amazonaws.mobile.client.results.UserCodeDeliveryDetails)4 AuthUserAttribute (com.amplifyframework.auth.AuthUserAttribute)4 Activity (android.app.Activity)3 SignInResult (com.amazonaws.mobile.client.results.SignInResult)3 Tokens (com.amazonaws.mobile.client.results.Tokens)3 AuthResetPasswordResult (com.amplifyframework.auth.result.AuthResetPasswordResult)3 AuthUpdateAttributeResult (com.amplifyframework.auth.result.AuthUpdateAttributeResult)3