Message: ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context

前端 未结 2 1396
孤街浪徒
孤街浪徒 2021-02-06 12:05

We\'re getting the exact same error as in this thread ... in our production environment. [WIF Security Token Caching

Does anybody have a fix to this error ? Message: ID

2条回答
  •  春和景丽
    2021-02-06 12:40

    this post helped me, so it can help you and others those have this kind of error.

    void Application_OnError()
    {
      var ex = Context.Error;
      if (ex is SecurityTokenException){
         Context.ClearError();
         if (FederatedAuthentication.SessionAuthenticationModule != null){
             FederatedAuthentication.SessionAuthenticationModule.SignOut();
         }
       Response.Redirect("~/");
      }
    }
    

    From this link.

    Hope it was useful!

提交回复
热议问题