We are rendering our application within an IFrame. Application is secured within Azure Active Directory. Whenever Access Token Expires, or user accessing for first time, Azure Active Directory Login or Consent window is not displayed in IFrame, since X-Frame-Option is deny for AAD Screens, Is there a way to know Session has got expired using JS. If session expire, show popup screen with Login page of AAD. We are trying to get access token based on Refresh token. Please let me know if there is better way for handling access token.
Asked
Active
Viewed 700 times
2
-
You wan to check the expire time of access token or user sign-in status ?The application is a SPA app ? Have you used ADAL? – Nan Yu Jul 19 '17 at 05:35
-
Yes I would like to know Expire Time of Access Tokem.. – user145610 Jul 29 '17 at 09:56
2 Answers
0
The access token is a base 64 encoded JSON Web Token (JWT) and its contents can be inspected by running it through a decoder. You could decode the access token and check the Not Before and Expiration Time(exp) claims to verify that the token has not expired .
With javascript , please refer to this thread for how to decode jwt token . You could also using JavaScript library ,for example , jwt-decode .

Nan Yu
- 26,101
- 9
- 68
- 148
0
If you looking to manually check the expiry time of the access token then use this tool https://jwt.ms/
Capture the access token while debugging and use this tool to decode it.

user3192613
- 43
- 1
- 7