Auth0 Federated Logout and Single Logout FAQ
Last Updated:
Overview
Auth0 provides capabilities for Federated Logout and Single Logout (SLO) to manage user sessions across multiple applications and identity providers. This document defines these concepts, explains the configuration for Auth0 acting as a Service Provider or Identity Provider, and answers common questions about logout flows.
Applies To
- Auth0
- Federated Logout
- Single Logout (SLO)
- Security Assertion Markup Language (SAML)
Solution
What are the definitions for Federated Logout and SLO?
Review the following definitions for Federated Logout and Single Logout (SLO).
- Federated Logout: Signing a user out of the upstream Identity Provider (IdP) by using the
?federatedquerystring parameter on the Auth0 logout endpoint. - Single Logout (SLO): Signing a user out of the upstream IdP and any other applications they are signed in to. This functions only in the context of Security Assertion Markup Language (SAML) interactions.
- Logout: Refers to both Federated Logout and SLO.
- IdP: Identity Provider. Auth0 acts as the IdP if the administrator enables the SAML2 Web App Addon for an application.
- SP: Service Provider. Usually an application, but can also be an identity service like Auth0 when an external IdP is configured as a SAML connection. Auth0 acts as the SP if an Enterprise SAML connection is configured.
A thorough understanding of session layers is critical before this document can be useful. Please reference the Auth0 session layers document as needed.
How does Federated Logout operate?
Auth0 signs the user out of certain upstream IdPs. See the list of IdPs for which federated logout is supported. Additional configuration is not required. Initiate federated logout by redirecting the user to the following endpoint.
https://<your_domain>/v2/logout?federated
The application must terminate the user session before redirecting the user to the Auth0 /logout endpoint. Auth0 terminates the user's Auth0 session and redirects the user to the IdP logout endpoint, which terminates the session with the IdP. The application specifies the returnTo parameter to redirect the user after logout completes. See this document: Redirect Users After Logout. Note that not all IdPs support returnTo.
NOTE: The limitations of federated logout.
How does SAML SLO operate?
True SAML SLO functions only when Auth0 acts as a SAML IdP but does not initiate the logout. Auth0 does not support IdP-initiated SLO when Auth0 acts as the SAML IdP. When Auth0 acts as a SAML SP, Auth0 sends a SAML logout request to the upstream IdP, but other applications do not receive notifications.
Auth0 acts as a SAML Service Provider (SP).
When Auth0 acts as the SP, SLO functions similarly to federated logout, especially for SP-initiated SLO.
How is the SAML SP configured?
The administrator configures a SAML logout URL in the SAML connection. The SLO endpoint appears as SingleLogoutService in the SAML metadata. If a logout URL is absent, Auth0 sends SAML logout requests to the SAML sign-in endpoint.
Configure the SAML IdP to send SAML logout responses to the following URL.
https://<your_domain>/logout
How does the SAML SP operate?
The following sections describe the mechanics of initiating SLO. The terms SP-initiated and IdP-initiated describe SLO flows. The SLO flow does not need to match the initial login flow. For example, IdP-initiated SLO might follow an SP-initiated sign-in.
SP-initiated SLO
Initiate SP-initiated SLO by making a GET request to the Auth0 logout endpoint with the federated parameter.
https://<your_domain>/v2/logout?federated
Auth0 sends a logout request to the appropriate endpoint on the SAML IdP. Upon receiving the request, the IdP determines whether to execute a full SLO flow to any other SAML SPs associated with the session. Eventually, the IdP returns a logout response to Auth0. If the response status indicates success, Auth0 terminates the user's Auth0 session. If the response does not indicate success, the user session remains active.
IdP-initiated SLO
Initiate IdP-initiated SLO by sending a SAML logout request to the Auth0 tenant at the following URL.
https://<your_domain>/logout
Auth0 terminates the user session and returns a SAML logout response to the SLO endpoint on the IdP. Review the following details regarding IdP-initiated SLO.
- The application does not directly call any Auth0 endpoints.
- The endpoint to initiate SLO on the IdP or SP might differ from the SingleLogoutService endpoint that receives SAML logout requests. For Auth0, the SingleLogoutService endpoint is
/logout, and the endpoint to request SLO is/v2/logout?federated.
Auth0 Acts as a SAML Identity Provider (IdP)
How is the SAML IdP configured?
The administrator configures the SAML2 Web App Addon for SLO. Configure the SAML2 Web App Addon settings with the following JSON structure.
{
"logout": {
"callback": "<callback_url>",
"slo_enabled": true
}
}
The <callback_url> represents the endpoint on the SAML SP that consumes the SAML logout response. Configure the SAML SP to send SAML logout requests to the following URL.
https://<your_domain>/samlp/<client_id>/logout
The <client_id> represents the application where the SAML2 Web App Addon is configured.
How does the SAML IdP operate?
The following sections describe the mechanics of initiating SLO. The terms SP-initiated and IdP-initiated describe SLO flows. The SLO flow does not need to match the initial login flow.
SP-initiated SLO
Initiate SLO from the SP by sending a SAML logout request to the following endpoint.
https:///<your_domain>/samlp/<client_id>/logout
Auth0 uses the logout response to locate the user session. If the user holds sessions with other SAML SPs, Auth0 redirects the user to all of those SPs sequentially. Auth0 sends a SAML logout response to the SP. The SP must display the results of the SLO attempt to the user.
Auth0 notifies only SAML applications. If the user holds application-level sessions open with applications using other protocols, such as OpenID Connect (OIDC), those sessions remain active.
IdP-initiated SLO
Auth0 does not support IdP-initiated SLO when Auth0 acts as the SAML IdP. Redirect the user to perform a GET request on the following endpoint.
https://<your_domain>/v2/logout?federated
This action terminates the user's Auth0 session and the session with an upstream IdP. Auth0 does not notify other applications. Review the Federated Logout section for more information.
What is the difference between requesting SLO and sending a SAML logout request?
Requesting SLO occurs when an application requests SLO via a specific endpoint. Request SLO via the following Auth0 endpoint.
https://<your_domain>/v2/logout?federated
If Auth0 acts as the SAML SP and the browser sends a GET request to this URL, the Auth0 tenant generates a SAML logout request and directs the browser to send it to the SLO endpoint on the SAML IdP.
This is shown in a sequence diagram linked here.
SAML applications generate a logout request directly and send it to the SLO endpoint of a SAML IdP or SP. If Auth0 acts as the SAML IdP, generate a logout request from a SAML application and direct the browser to the following endpoint.
https://<your_domain>/v2/logout?federated
What occurs if a user signs into Auth0 with multiple IdPs?
Auth0 tracks only the session from the most recent upstream IdP interaction. If an application requests federated logout, Auth0 notifies the upstream IdP from the most recent interaction.