asp.net mvc 4 - Unable to sign out from Active Directory when using Azure ACS -
i using acs 2.0 in mvc 4 application.
it configured signing in, , works various providers including adfs. need implement sign-out functionality.
as this question outdated, used code these samples:
here how looks like:
// load identity configuration federationconfiguration config = federatedauthentication.federationconfiguration; // wtrealm wsfederationconfiguation section string wtrealm = config.wsfederationconfiguration.realm; string wreply = wtrealm; //return url // read acs ws-federation endpoint web.config string wsfederationendpoint = configurationmanager.appsettings["ida:issuer"]; signoutrequestmessage signoutrequestmessage = new signoutrequestmessage(new uri(wsfederationendpoint)); signoutrequestmessage.parameters.add("wreply", wreply); signoutrequestmessage.parameters.add("wtrealm", wtrealm); federatedauthentication.sessionauthenticationmodule.signout(); var signouturl = signoutrequestmessage.writequerystring();
as result, sign-out url should redirect, dispose tokens , send me back. url looks following:
https://myacsnamespace.accesscontrol.windows.net/v2/wsfederation?wa=wsignout1.0&wreply=http%3a%2f%2flocalhost%3a61192%2f&wtrealm=http%3a%2f%2flocalhost%3a61192%2f
as result, works expected google, yahoo, , microsoft accounts. when sign-out, , try access protected area, list of identity providers, , have sign-in again, if choose same provider.
but when use adfs provider, works that:
i click sign out , page of available providers
i select adfs provider again
i protected area old ad credentials
if have adfs provider, step 2 above skipped, , keep being sign-in without ability change user.
as see happens, acs not dispose security token got adfs, , re-uses it.
do have leads on how can force acs dispose token?
thanks in advance!
+1 @oren-melzer's answer: browsers cache http basic credentials , automatically re-send them. either move forms auth (which uses cookies) or on logout, deny browser's auth header, returning 401. "return 401 valid credentials" works clear browser, must require users close browser.
Comments
Post a Comment