Example usage for com.amazonaws.services.cognitoidp.model GlobalSignOutRequest setAccessToken

List of usage examples for com.amazonaws.services.cognitoidp.model GlobalSignOutRequest setAccessToken

Introduction

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

Prototype


public void setAccessToken(String accessToken) 

Source Link

Document

The access token.

Usage

From source file:io.fineo.client.auth.cognito.CognitoUser.java

License:Open Source License

/**
 * Internal method to Sign-Out from all devices of this user.
 *
 * @param session                  REQUIRED: {@link GenericHandler} callback.
 *//*from   ww w  . j a v a2 s  .  co  m*/
private void globalSignOutInternal(CognitoUserSession session) {
    // Check if session is valid
    if (session == null) {
        throw new CognitoNotAuthorizedException("user is not authenticated");
    }

    if (!session.isValid()) {
        throw new CognitoNotAuthorizedException("user is not authenticated");
    }

    GlobalSignOutRequest globalSignOutRequest = new GlobalSignOutRequest();
    globalSignOutRequest.setAccessToken(getCachedSession().getAccessToken().getJWTToken());

    cognitoIdentityProviderClient.globalSignOut(globalSignOutRequest);
}