Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WIF with asp.net MVC 3, where do I define the STS Sign out endpoint?

I see that the FedMetadata document can provide signout notification and subscription endpoints, and web.config defines the issuer url for sign in requests, but I can't find where WIF knows to send sign out requests. If the STS I'm using defines different endpoints for sign in and sign out requests, how could I access that in code or set that up in web.config?

like image 633
ryanhallcs Avatar asked Oct 10 '22 01:10

ryanhallcs


1 Answers

By default, WIF will redirect to the same STS endpoint for sign-out as was used for sign-in. To direct to a different endpoint, you'll need to override the sign-out action using FederatedSignOut:

WSFederationAuthenticationModule authModule = FederatedAuthentication.WSFederationAuthenticationModule;

string signoutEndpoint = "http://STS/yourendpoint/";  // This can be stored in your configuration app settings
string signoutUrl = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(signoutEndpoint, authModule.Realm, null);

WSFederationAuthenticationModule.FederatedSignOut(new Uri(signoutUrl), new Uri(currentPage));

Hopefully this helps.

like image 200
Garrett Vlieger Avatar answered Oct 19 '22 14:10

Garrett Vlieger