How to logout from all providers in AWS Cognito?

Viewed 4943

I use AWS Cognito authentication in my web application. Users can authenticate using one of the three identity providers: cognito user pool (by username and password), facebook and google. Here is how I get credentials:

AWS.config.credentials = new AWS.CognitoIdentityCredentials({
    IdentityPoolId: identityPoolId,
    Logins: logins
});
AWS.config.credentials.get(err => {
    console.log("Amazon Cognito Identity", 
    AWS.config.credentials.identityId);
});

logins - Object, that can contain tokens from cognito, facebook and google.

What should web application does if user click logout button? I could do userPool.getCurrentUser().signOut() if current user is exists (current user is exists only in cognito username, password authentication) But what should I do if somebody signs in using facebook or google?

2 Answers
Related