Id token (which is used as bearer token) does not get expire after user is logged out.

0

After user logs out of the system the bearer token is not invalidated automatically. I can still use the token to access the resources. For sign out I'm using amplify auth.signout(). Does invalidating refresh token invalidates id token? is there any way to invalidate id token. jwt.verify() is still passing the request after I tried invalidating refresh token. Any solution. I dont want to use global signout.

2개 답변
1

Does invalidating refresh token invalidates id token?

When you call amplify.auth.signout(), this particular method is used to sign out the currently authenticated user from the application. When a user signs out, their session is invalidated, and they will need to authenticate again to access any resources or features that require authentication.

You can also sign out users from all devices by performing a global sign-out. This will also invalidate all refresh tokens issued to a user. The user's current access and ID tokens will remain valid on other devices until the refresh token expires (access and ID tokens expire one hour after they are issued).

amplify.auth.signout({ global: true })

Key souces:

profile picture
전문가
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
1

Hi,

As described on the AWS documentation, JWT tokens, such as access_token and id_token, are self-contained with a signature and expiration time that was assigned when the token was created.

Therefore, revoked tokens will still be valid if they are verified using any JWT library that only verifies the signature and expiration of the token, which is the most common method.

profile picture
전문가
답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠