katana - OWIN WS-FED Passive signout of identity provider -
so have solution using microsoft.owin.security.wsfederation 3.0.0-rc2 , i'm trying passive sign-out calling identity provider log out of there application (so don't redirect loop logging in).
i'm using waad ws-fed endpoint.
app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/login") }); app.setdefaultsigninasauthenticationtype(defaultauthenticationtypes.applicationcookie); app.useexternalsignincookie(defaultauthenticationtypes.externalcookie); app.usewsfederationauthentication(new wsfederationauthenticationoptions { authenticationmode = microsoft.owin.security.authenticationmode.passive, authenticationtype = wsfederationauthenticationdefaults.authenticationtype, wtrealm = configurationmanager.appsettings["wsfedrealm"], metadataaddress = configurationmanager.appsettings["wsfedmetadataaddress"] });
i can working fine if use active nice have option of using passive well.
i signing out using:
_authenticationmanager.signout();
i think has these lines in signout helper
if (revoke.authenticationtypes == null || revoke.authenticationtypes.length == 0) { return authenticationmode == authenticationmode.active ? revoke : null; }
but i'm unsure of how add revoke.authenticationtypes dictionary?
a potential solution manually force signout1.0 request
var wsconfiguration = await _wsconfigurationmanager.getconfigurationasync(httpcontext.getowincontext().request.callcancelled); var message = new wsfederationmessage { issueraddress = wsconfiguration.tokenendpoint, wtrealm = configurationmanager.appsettings["wsfedrealm"], wreply = url.action("index", "home", null, request.url.scheme), wa = "wsignout1.0" };
i have binding in ninject module wsfederation configuration
bind<iconfigurationmanager<wsfederationconfiguration>>().tomethod((c) => { var owincontext = httpcontext.current.getowincontext().authentication; return new configurationmanager<wsfederationconfiguration>(configurationmanager.appsettings["wsfedmetadataaddress"]); }).insingletonscope();
i'm not 100% happy solution means there 2 running configuration managers metadata, working solution.
Comments
Post a Comment