Example usage for com.amazonaws.services.cognitoidentity.model GetIdRequest GetIdRequest

List of usage examples for com.amazonaws.services.cognitoidentity.model GetIdRequest GetIdRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.cognitoidentity.model GetIdRequest GetIdRequest.

Prototype

GetIdRequest

Source Link

Usage

From source file:io.fineo.client.auth.AWSAbstractCognitoIdentityProvider.java

License:Open Source License

/**
 * Gets a reference to the identityId of the user (sending a new request if
 * it isn't yet set), using the dev accountId, identityPoolId, and the
 * user's loginsMap to identify.//from ww w. ja v a2  s.c o m
 */
@Override
public String getIdentityId() {
    if (identityId == null) {
        GetIdRequest getIdRequest = new GetIdRequest().withAccountId(getAccountId())
                .withIdentityPoolId(getIdentityPoolId()).withLogins(loginsMap);

        appendUserAgent(getIdRequest, getUserAgent());

        GetIdResult getIdResult = cib.getId(getIdRequest);

        if (getIdResult.getIdentityId() != null) {
            identityChanged(getIdResult.getIdentityId());
        }
    }
    return identityId;
}