2014-09-15 5 views
0

WSfederationAuthentication을 사용하여 내 응용 프로그램에서 로그 아웃하는 문제가 있습니다.WAAD 사무실로 리디렉션 됨 365 로그인 페이지

FormsAuthentication.SignOut(); 

      if (FederatedAuthentication.SessionAuthenticationModule != null) 
      { 
       FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie(); 
       FederatedAuthentication.SessionAuthenticationModule.SignOut(); 
      } 

      if (FederatedAuthentication.WSFederationAuthenticationModule != null) 
      { 
       WSFederationAuthenticationModule authModule = 
        FederatedAuthentication.WSFederationAuthenticationModule; 
       authModule.SignOut(true); 

       String signoutURL = WSFederationAuthenticationModule.GetFederationPassiveSignOutUrl(
        authModule.Issuer, 
        authModule.Realm", 
        null); 

       WSFederationAuthenticationModule.FederatedSignOut(
        new Uri(signoutURL), 
        new Uri(authModule.Realm));      
      } 

쿠키는 등 삭제되지만 페이지가 마이크로 소프트 오피스 365 로그인 페이지 대신 내 응용 프로그램에 적절한 로그인 페이지로 리디렉션됩니다 : 로그 아웃에 나는 다음과 같은 코드를 실행합니다.

발급자 및 영역이 올바른지 발급자 있습니다 https://login.windows.net/EndpointID/wsfed 영역 :은 https : // localhost를 :

: 다음 444 (내 응용 프로그램의 기본 주소, 로컬 호스트)

내가 로그 아웃을 클릭 한 후 피들러 로그입니다

이 사람들

http://login.windows.net:443 
https://login.windows.net/EndpointID/wsfed?wa=wsignout1.0&wreply=https%3a%2f%2f127.0.0.1%3a444%2f 
https://localhost:444/?wa=wsignoutcleanup1.0 
http://login.microsoftonline.com:443 
https://login.microsoftonline.com/login.srf?wa=wsignout1.0 
https://login.microsoftonline.com/logout.srf?wa=wsignout1.0&lc=1033 
https://login.windows.net/common/wsfed?wa=wsignoutcleanup1.0 **<<<<------ Why ?** 
http://login.microsoftonline-p.com:443 
https://login.microsoftonline-p.com/ThirdPartyCookieCheck.srf?ct=9348739876 
https://login.microsoftonline-p.com/ThirdPartyCookieCheck.srf?tpc=394875457987&lc=1033 
https://login.microsoftonline.com/?lc=1033 
가 유사한 문제에 직면하고, 더 해상도 : 아니오 응답으로 http://social.msdn.microsoft.com/Forums/vstudio/en-US/ac41c0c5-83ef-4394-9111-fa6d07215f5d/adfs-20-does-not-redirect-back-to-reply-url-on-signout?forum=Geneva

답변

0

여기에서 나는 다른 사람이 전자가 없음을지지 않습니다 ver에이 문제가 발생했습니다. D.

나는 여기를 찾는 사람들을 위해 해결책을 찾았습니다.

그래서 MSDN에 'WSFederationAuthenticationModule.FederatedSignOut'문서에 따라 :

콜이 방법은 지정된 STS tothe WS-연맹 로그 아웃 요청 메시지를 보낼 수 있습니다. 선택적으로 로그 아웃 요청에서 wreply 매개 변수의 값을 제공 할 수 있습니다. 이 메서드는 다음 작업을 수행합니다.

  1. 지정된 매개 변수를 사용하여 WS-Federation 로그 아웃 요청 메시지를 만듭니다.

  2. 세션 쿠키를 삭제하기 위해 SAM에서 SessionAuthenticationModule.DeleteSessionTokenCookie 메서드를 호출합니다.

  3. 첫 번째 단계에서 로그 아웃 요청 메시지를 사용하여 STS로 리디렉션합니다. :(광고로이 작동하지 않는 나를 위해 몇 가지 이유를 들어

는. 그래서 나는 완벽하게 일을 수동으로 3 가지로 결정했다. 문제가 제공하는 래퍼가 작동하지 않는 이유는 지금 여전히 궁금 대한 해결했다. 이 도움이

FederatedAuthentication.SessionAuthenticationModule.DeleteSessionTokenCookie(); 
FederatedAuthentication.SessionAuthenticationModule.SignOut(); 

WSFederationAuthenticationModule wsfederationAuthenticationModule = FederatedAuthentication.WSFederationAuthenticationModule; 
wsfederationAuthenticationModule.SignOut(true); 
signOutRequestMessageuestMessage signOutRequestMessage = new signOutRequestMessageuestMessage(new Uri(wsfederationAuthenticationModule.Issuer)); 
signOutRequestMessage.Parameters.Add("wreply", wsfederationAuthenticationModule.Realm); 
signOutRequestMessage.Parameters.Add("wtrealm", wsfederationAuthenticationModule.Realm); 
signOutURI = signOutRequestMessage.WriteQueryString(); 
Redirect(signOutURI) 

희망.

Gaurav