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

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

Introduction

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

Prototype

GlobalSignOutRequest

Source Link

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 w ww  .  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);
}