List of usage examples for com.amazonaws.services.cognitoidp.model AttributeType getValue
public String getValue()
The value of the attribute.
From source file:io.fineo.client.auth.cognito.CognitoUser.java
License:Open Source License
/** * Creates a authentication request to start authentication with user SRP verification. * * @param authenticationDetails REQUIRED: {@link AuthenticationDetails}, contains details for * user SRP authentication. * @param authenticationHelper REQUIRED: Internal helper class for SRP calculations. * @return {@link InitiateAuthRequest}, request to start with the user SRP authentication. *//*from www.j av a 2 s .co m*/ private InitiateAuthRequest initiateUserSrpAuthRequest(AuthenticationDetails authenticationDetails, AuthenticationHelper authenticationHelper) { userId = authenticationDetails.getUserId(); InitiateAuthRequest initiateAuthRequest = new InitiateAuthRequest(); initiateAuthRequest.setAuthFlow("USER_SRP_AUTH"); initiateAuthRequest.setClientId(clientId); initiateAuthRequest.addAuthParametersEntry("SECRET_HASH", CognitoSecretHash.getSecretHash(userId, clientId, clientSecret)); initiateAuthRequest.addAuthParametersEntry("USERNAME", authenticationDetails.getUserId()); initiateAuthRequest.addAuthParametersEntry("SRP_A", authenticationHelper.getA().toString(16)); setDeviceAuthKey(initiateAuthRequest, authenticationDetails.getUserId()); if (authenticationDetails.getValidationData() != null && authenticationDetails.getValidationData().size() > 0) { Map<String, String> userValidationData = new HashMap<String, String>(); for (AttributeType attribute : authenticationDetails.getValidationData()) { userValidationData.put(attribute.getName(), attribute.getValue()); } initiateAuthRequest.setClientMetadata(userValidationData); } return initiateAuthRequest; }
From source file:io.fineo.client.auth.cognito.CognitoUserAttributes.java
License:Open Source License
/** * Constructor for internal use.// www . ja v a 2s . com * * @param userAttributes REQUIRED: Cognito user attributes as a list. */ protected CognitoUserAttributes(List<AttributeType> userAttributes) { this.userAttributes = new HashMap<String, String>(); if (userAttributes != null) { for (AttributeType attribute : userAttributes) { this.userAttributes.put(attribute.getName(), attribute.getValue()); } } }