0

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

karthik
  • 33
  • 8
  • Related: https://stackoverflow.com/questions/53415086/cannot-sign-out-the-user-from-aws-cognito – jarmod Aug 17 '21 at 00:16
  • i dont think its related. I can call globalsignout and logout the user from all the sessions. it works fine but i need to logout the user from only one session but not all like in the global signout. – karthik Aug 17 '21 at 17:06

1 Answers1

2

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.

karthik
  • 33
  • 8