c# - How to force Federated signout redirect to login page? -


i'm using wsfederationauthentication module authentication. want this: after user press logout button, signs out (delete cookies) , redirect login page. have code logout button:

var ls = new loginstatus(); ls.logoutaction = logoutaction.redirect; ls.logoutpageurl = {some url, have sign out code} 

signout part:

microsoft.identitymodel.web.wsfederationauthenticationmodule authmodule = federatedauthentication.wsfederationauthenticationmodule; string signouturl = wsfederationauthenticationmodule.getfederationpassivesignouturl( authmodule.issuer, {login url}, null);  wsfederationauthenticationmodule.federatedsignout( new uri(signouturl), new uri(authmodule.realm)); 

this code signout , delete cookies, not redirect login page. still, url, users sees contains part: &wreply={loginurl}

as understand wreply parameter not used.

instead of using federatedsignout() method tried one:

system.net.webrequest req = system.net.webrequest.create(signouturl); system.net.webresponse resp = req.getresponse(); redirect(loginurl); 

but, doesn't sign out. when user tries log in next time, doesn't need enter credentials , signed in automatically. guess, not cookies deleted.

so, there question, how can sign out , force redirect login page?

p.s. delete fedauth cookies myself.

i think may have misunderstood how federated sign on , sign out work (i have neglected mention consider important thing.)

when attempt login application uses ws-federation redirected identity provider (idp) , login idp. once logged idp redirected site security token , logged in site also.

at stage logged in 2 applications in effect:

  1. the idp
  2. your web site

what trying achieve?

  1. logging out of site only
  2. federated sign out (i.e. signing out of idp , site , other relying partys)

if in case 1 simple. delete cookies , fine still logged idp , when user navigates site , gets redirected idp redirected site security token without being prompted credentials , logged site again, seems bit pointless.

given this, think after scenario 2. in case, functionality want depends on software using idp, have neglected mention in question.

unfortunately don't believe there generic way want idp's , more idp's won't directly support it.

i think may best raising question how idp works , how work. things include in question possibly url's of site , idp (not purposes of "checking them out" because other indirect solutions may possible if come under same domain name). infrastructure of idp , site helpful again specific setups give indirect solutions.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -