注销时ADFS 3.0不会重定向

时间:2016-12-19 11:39:41

标签: url adfs

1 个答案:

答案 0 :(得分:0)

            string absoluteUrl = HttpContext.Request.Url.AbsoluteUri;
            string replyUrl = absoluteUrl.Substring(0, absoluteUrl.LastIndexOf("/") + 1);
            var issuer = FederatedAuthentication.WSFederationAuthenticationModule.Issuer;
            var signOutUrl = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(issuer, null, null);
            WSFederationAuthenticationModule.FederatedSignOut(new Uri(signOutUrl), new Uri(replyUrl));
            FederatedAuthentication.SessionAuthenticationModule.SignOut();
            Response.Redirect(Request.RawUrl);

试试这个。可能有帮助。