Example usage for com.amazonaws.services.cognitoidentity.model GetOpenIdTokenResult getIdentityId

List of usage examples for com.amazonaws.services.cognitoidentity.model GetOpenIdTokenResult getIdentityId

Introduction

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

Prototype


public String getIdentityId() 

Source Link

Document

A unique identifier in the format REGION:GUID.

Usage

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

License:Open Source License

/**
 * With the logins and identityId to mark the user, it builds a request to
 * the cognito back end, and returns the token cib hands back
 *//*from w  w w  .ja  v  a2 s  .co  m*/
@Override
public String getToken() {
    if (this.token == null) {
        GetOpenIdTokenRequest getTokenRequest = new GetOpenIdTokenRequest().withIdentityId(getIdentityId())
                .withLogins(loginsMap);

        appendUserAgent(getTokenRequest, getUserAgent());

        GetOpenIdTokenResult getTokenResult = cib.getOpenIdToken(getTokenRequest);

        if (!getTokenResult.getIdentityId().equals(getIdentityId())) {
            identityChanged(getTokenResult.getIdentityId());
        }
        this.token = getTokenResult.getToken();
    }
    return token;
}