Question

Here is my issue. I have set up a WIF RP, a custom STS, and ADFS. ADFS has the appropriate claims provider trust and relying part trust. When I trigger a signout from the RP, I do it using the following code:

WSFederationAuthenticationModule.FederatedSignOut(null, new Uri("https://myrelyingpartyapp.com/Default.aspx));

This works fine. I am logged out by the STS, and then it attempts to redirect me back to my relying party app. The relying party app says I am not authenticated and I end up back at the login page of the STS. So far, so good. The problem is that if I try to log in with a different user, the relying part app still thinks I am the previous user. So what am I missing? How do I make the relying party app forget my previous user? I have experimented with wsignoutcleanup1.0 with no luck.

Was it helpful?

Solution

I found this code that works for me.

var module = FederatedAuthentication.WSFederationAuthenticationModule;
module.SignOut(false);
var request = new SignOutRequestMessage(new Uri(module.Issuer), module.Realm);
Response.Redirect(request.WriteQueryString());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top