List of usage examples for com.amazonaws.services.cognitoidp.model RespondToAuthChallengeResult setAuthenticationResult
public void setAuthenticationResult(AuthenticationResultType authenticationResult)
The result returned by the server in response to the request to respond to the authentication challenge.
From source file:io.fineo.client.auth.cognito.CognitoUser.java
License:Open Source License
/** * Determines the next step from the challenge. * This takes an object of type {@link InitiateAuthResult} as parameter and creates an object of type * {@link RespondToAuthChallengeResult} and calls {@code handleChallenge(RespondToAuthChallengeResult challenge, final AuthenticationHandler callback)} method. * * @param authResult REQUIRED: Result from the {@code initiateAuth(...)} method. * @param callback REQUIRED: Callback for type {@link AuthenticationHandler} * @param runInBackground REQUIRED: Boolean to indicate the current threading. * @return {@link Runnable} for the next step in user authentication. */// ww w . j ava 2 s .c o m private Runnable handleChallenge(final InitiateAuthResult authResult, final AuthenticationHandler callback, final boolean runInBackground) { try { RespondToAuthChallengeResult challenge = new RespondToAuthChallengeResult(); challenge.setChallengeName(authResult.getChallengeName()); challenge.setSession(authResult.getSession()); challenge.setAuthenticationResult(authResult.getAuthenticationResult()); challenge.setChallengeParameters(authResult.getChallengeParameters()); return handleChallenge(challenge, callback, runInBackground); } catch (final Exception e) { return new Runnable() { @Override public void run() { callback.onFailure(e); } }; } }