Example usage for com.amazonaws.services.cognitoidp.model AttributeType getName

List of usage examples for com.amazonaws.services.cognitoidp.model AttributeType getName

Introduction

In this page you can find the example usage for com.amazonaws.services.cognitoidp.model AttributeType getName.

Prototype


public String getName() 

Source Link

Document

The name of the attribute.

Usage

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.
 *//*w ww.j  ava2s . c o 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./*from   www.ja  va  2 s.  c  om*/
 *
 * @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());
        }
    }
}