I get the following error randomly when I work in my app:
Invalid JWT token. The token is expired.
[SecurityTokenExpiredException: Invalid JWT token. The token is expired.]
Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ValidateLifetime(JsonWebSecurityToken token) +296
Microsoft.IdentityModel.S2S.Tokens.JsonWebSecurityTokenHandler.ValidateTokenCore(SecurityToken token, Boolean isActorToken) +162
EventsWeb.TokenHelper.ReadAndValidateContextToken(String contextTokenString, String appHostName) in C:\APP\TokenHelper.cs:120
EventsWeb.TokenHelper.GetClientContextWithContextToken(String targetUrl, String contextTokenString, String appHostUrl) in C:\APP\TokenHelper.cs:465
EventsWeb.Pages.User.tmpl.index.GetHostWebClientContext() in C:\APP\Pages\User\tmpl\index.aspx.cs:90
EventsWeb.Pages.User.tmpl.index.OnPreRender(EventArgs e) in C:\APP\Pages\User\tmpl\index.aspx.cs:69
System.Web.UI.Control.PreRenderRecursiveInternal() +107
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7675
There is no way except of restarting the Internet Explorer to solve this issue. I have this in some applications. The ClientId and ClientSecret is valid, otherwise the restart of IE won't be able to solve this problem.
The time when this message occurs differs. Sometimes after 1hour sometimes after 5...
I don't know why the token is getting invalid due the working in this app. But thats not userfriendly...
Any idea about this?
Thanks