I'm using IdentityServer2 with an MVC application I have the following action:
[Authorize]
public void SignOut()
{
var authModule = FederatedAuthentication.WSFederationAuthenticationModule;
// clear local cookie
authModule.SignOut();
// initiate federated sign out request to the STS
var signOutRequestMessage = new SignOutRequestMessage(new Uri(authModule.Issuer), authModule.Realm + "/account/message");
var queryString = signOutRequestMessage.WriteQueryString();
Response.Redirect(queryString);
}
What I am trying to do is get the identity server to redirect to my custom Thank You page (displayed by the Message action in the Account controller) after signing the user out. But it always redirects to its own sign out page.
I also tried the following to no avail:
[Authorize]
public void SignOut()
{
var fam = FederatedAuthentication.WSFederationAuthenticationModule;
var wrealm = string.Format("wtrealm={0}", fam.Realm);
var signOutUrl = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(fam.Issuer, null, wrealm);
var wreply = "http://localhost/myapplication/account/message";
WSFederationAuthenticationModule.FederatedSignOut(new Uri(signOutUrl), new Uri(wreply));
}
I'm using IdentityServer2 with an MVC application I have the following action:
[Authorize] public void SignOut() { var authModule = FederatedAuthentication.WSFederationAuthenticationModule;
}
What I am trying to do is get the identity server to redirect to my custom Thank You page (displayed by the Message action in the Account controller) after signing the user out. But it always redirects to its own sign out page.
I also tried the following to no avail:
[Authorize] public void SignOut() { var fam = FederatedAuthentication.WSFederationAuthenticationModule; var wrealm = string.Format("wtrealm={0}", fam.Realm); var signOutUrl = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(fam.Issuer, null, wrealm); var wreply = "http://localhost/myapplication/account/message"; WSFederationAuthenticationModule.FederatedSignOut(new Uri(signOutUrl), new Uri(wreply)); }
Any help is greatly appreciated.