How to avoid 'SamlAssertion.NotOnOrAfter condition is not satisfied' errors

Deadly 提交于 2019-12-06 10:38:40

The following FederatedAuthentication.WSFederationAuthenticationModule.SignInError event handler method sorted out the problem:

    protected void WSFederationAuthenticationModule_SignInError(object sender, ErrorEventArgs e)
    {
        // handle an intermittent error that most often occurs if you are redirected to the STS after a session expired,
        // and the user clicks back on the browser - second error very uncommon but this should fix
        if (e.Exception.Message.StartsWith("ID4148") ||
            e.Exception.Message.StartsWith("ID4243") ||
            e.Exception.Message.StartsWith("ID4223"))
        {
            FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie();
            e.Cancel = true;
        }
    }

It will delete the Session Token Cookie that persisted, even after the user has been redirected to the STS service after a session has expired.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!