0
antonis created
Hi,
How do I get Token expiration date?
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
3 Answer(s)
-
0
- What is your product version?
- What is your product type (Angular or MVC)?
- What is product framework type (.net framework or .net core)?
Are you using JWT or Identity server?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
6.5 angular .net core. I m using default authentication. I suppose is JWT isn't it?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You can get the jwt token from the HttpContext via
IHttpContextAccessorand parse it.var jwt = "(the JTW here)"; var handler = new JwtSecurityTokenHandler(); var token = handler.ReadJwtToken(jwt); // now do something with token.Claims, token.Audiences, etc.https://stackoverflow.com/questions/38340078/how-to-decode-jwt-token https://developer.okta.com/blog/2019/06/26/decode-jwt-in-csharp-for-authorization
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)