Overview
Windows Server 2012 R2의 AD FS에서 초기 Oauth 지원을 기반으로 AD FS 2016에서 OpenId Connect 로그온 지원을 도입했습니다. With KB4038801, AD FS 2016 now supports single log-out for OpenId Connect scenarios. 이 문서에서는 OpenId Connect 시나리오의 단일 로그아웃 개요를 제공하고, 이를 AD FS의 OpenId Connect 애플리케이션에 사용하는 방법을 제공합니다.
Discovery doc
OpenID Connect는 "검색 설명서"라는 JSON 문서를 사용하여 구성에 관한 세부 정보를 제공합니다. 여기에는 인증, 토큰, 사용자 정보 및 퍼블릭 엔드포인트의 URI가 포함됩니다. 다음은 디스커버리 문서의 예입니다.
{
"issuer":"https://fs.fabidentity.com/adfs",
"authorization_endpoint":"https://fs.fabidentity.com/adfs/oauth2/authorize/",
"token_endpoint":"https://fs.fabidentity.com/adfs/oauth2/token/",
"jwks_uri":"https://fs.fabidentity.com/adfs/discovery/keys",
"token_endpoint_auth_methods_supported":["client_secret_post","client_secret_basic","private_key_jwt","windows_client_authentication"],
"response_types_supported":["code","id_token","code id_token","id_token token","code token","code id_token token"],
"response_modes_supported":["query","fragment","form_post"],
"grant_types_supported":["authorization_code","refresh_token","client_credentials","urn:ietf:params:oauth:grant-type:jwt-bearer","implicit","password","srv_challenge"],
"subject_types_supported":["pairwise"],
"scopes_supported":["allatclaims","email","user_impersonation","logon_cert","aza","profile","vpn_cert","winhello_cert","openid"],
"id_token_signing_alg_values_supported":["RS256"],
"token_endpoint_auth_signing_alg_values_supported":["RS256"],
"access_token_issuer":"http://fs.fabidentity.com/adfs/services/trust",
"claims_supported":["aud","iss","iat","exp","auth_time","nonce","at_hash","c_hash","sub","upn","unique_name","pwd_url","pwd_exp","sid"],
"microsoft_multi_refresh_token":true,
"userinfo_endpoint":"https://fs.fabidentity.com/adfs/userinfo",
"capabilities":[],
"end_session_endpoint":"https://fs.fabidentity.com/adfs/oauth2/logout",
"as_access_token_token_binding_supported":true,
"as_refresh_token_token_binding_supported":true,
"resource_access_token_token_binding_supported":true,
"op_id_token_token_binding_supported":true,
"rp_id_token_token_binding_supported":true,
"frontchannel_logout_supported":true,
"frontchannel_logout_session_supported":true
}
다음 추가 값은 검색 설명서에서 프런트 채널 로그아웃에 대한 지원을 나타내는 데 사용할 수 있습니다.
- frontchannel_logout_supported: 값은 ‘true’
- frontchannel_logout_session_supported: 값은 'true'가 될 것입니다.
- end_session_endpoint: 이것은 클라이언트가 서버에서 로그아웃을 시작하는 데 사용할 수 있는 OAuth 로그아웃 URI입니다.
AD FS 서버 구성
기본적으로 AD FS 속성 EnableOAuthLogout은 사용하도록 설정됩니다. 이 속성은 클라이언트에서 로그아웃을 시작하기 위해 SID를 사용하여 URL(LogoutURI)을 찾도록 AD FS 서버에 지시합니다. If you do not have KB4038801 installed you can use the following PowerShell command:
Set-ADFSProperties -EnableOAuthLogout $true
Note
EnableOAuthLogout
parameter will be marked as obsolete after installing KB4038801. 는 항상 참이어서 로그아웃 기능에 영향을 미치지 않습니다.
Note
frontchannel_logout is supported only after installation of KB4038801
Client configuration
클라이언트는 로그인한 사용자를 '로그오프'하는 url을 구현해야 합니다. 관리자는 클라이언트 구성에서 다음 PowerShell cmdlet을 사용하여 LogoutUri를 구성할 수 있습니다.
(Add | Set)-AdfsNativeApplication
(Add | Set)-AdfsServerApplication
(Add | Set)-AdfsClient
Set-AdfsClient -LogoutUri <url>
LogoutUri
는 AF FS에서 사용자를 "로그오프"하는 데 사용하는 URL입니다.
LogoutUri
를 구현하려면 클라이언트가 애플리케이션에서 사용자의 인증 상태를 해제하고, 예를 들어 보유한 인증 토큰을 삭제해야 합니다. AD FS는 SID를 쿼리 매개 변수로 사용하여 해당 URL로 이동하고 신뢰 당사자 / 애플리케이션이 사용자를 로그오프하도록 신호를 표시합니다.
AD FS 로그아웃 사용자 다이어그램
- 세션 ID가 있는 OAuth 토큰: AD FS에는 id_token 토큰 발급 시점에 OAuth 토큰에 세션 ID를 포함시킵니다. 이것은 나중에 AD FS가 사용자를 위해 정리할 관련 SSO 쿠키를 식별하는 데 사용됩니다.
- 사용자가 App1에서 로그아웃 시작: 사용자가 로그인한 애플리케이션에서 로그아웃을 시작할 수 있습니다. 이 예제 시나리오에서는 사용자가 App1에서 로그아웃을 시작합니다.
- 애플리케이션에서 AD FS로 로그아웃 요청 전송: 사용자가 로그아웃을 시작한 후에 애플리케이션이 AD FS의 end_session_endpoint로 GET 요청을 보냅니다. 애플리케이션이 필요에 따라 id_token_hint를 이 요청에 대한 매개 변수로 포함할 수 있습니다. id_token_hint가 있는 경우 AD FS는 이것을 세션 ID와 함께 사용하여 로그아웃 후 클라이언트를 리디렉션해야 하는 URI를 파악합니다(post_logout_redirect_uri). post_logout_redirect_uri는 RedirectUris 매개 변수를 사용하여 AD FS에 등록된 유효한 URI여야 합니다.
- AD FS가 로그인한 클라이언트에 로그아웃을 전송: AD FS가 세션 식별자 값을 사용하여 사용자가 로그인한 관련 클라이언트를 찾습니다. 식별된 클라이언트에게 AD FS에 등록된 LogoutUri에 요청을 보내 클라이언트 쪽에서 로그아웃을 시작합니다.
FAQs
Q: I do not see the frontchannel_logout_supported and frontchannel_logout_session_supported parameters in the discovery doc.
A: Ensure that you have KB4038801 installed on all the AD FS servers. Refer to Single log-out in Server 2016 with KB4038801.
Q: I have configured single logout as directed, but user stays logged-in on other clients.
A: Ensure that LogoutUri
is set for all the clients where the user is logged-in. AD FS는 등록된 LogoutUri
에 가능한 최선을 다해 로그아웃 요청을 보냅니다. 클라이언트는 요청을 처리하고 애플리케이션에서 사용자를 로그아웃하는 작업을 수행하도록 논리를 구현해야 합니다.
Q: If after logout, one of the clients goes back to AD FS with a valid refresh token, will AD FS issue an access token?
A: Yes. 등록된 LogoutUri
에서 로그아웃 요청이 수신되면 모든 인증 관련 데이터를 삭제하는 것은 클라이언트 애플리케이션의 책임입니다.
Next Steps
AD FS 개발