karthik
karthik

Reputation: 53

Logout from one session on aws cognito java

How can i logout the user from only one session using aws sdk compared to using globalSignout that logouts from all active sessions?

I looked around few other questions. one of them mentioned to use AdminForgetDevice method that'll force the user to logout. but i dont know what the DeviceKey is and where do i get it from?

Admin Forget device: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminForgetDevice.html

Upvotes: 1

Views: 1561

Answers (1)

karthik
karthik

Reputation: 53

Found the revoke token api: https://docs.aws.amazon.com/cognito/latest/developerguide/token-revocation.html

Used this api by sending the username and the refresh token which invalidated the active session and logged out the user.

Upvotes: 3

Related Questions