returnTo
query string parameter with the target URL as the value. Encode the target URL being passed in. For example, to redirect the user to https://www.example.com
after logout, make the following request:
https://{yourDomain}/v2/logout?returnTo=https%3A%2F%2Fwww.example.com
.
returnTo
URL (for example, https://www.example.com
) as an Allowed Logout URLs in one of two places:
client_id
parameter, you must add the returnTo
URL to the Allowed Logout URLs list in the Advanced tab of your Tenant Settings.
To add a list of URLs that the user may be redirected to after logging out at the tenant level, go to the Tenant Settings > Advanced of the Auth0 Dashboard.
client_id
parameter, you must add the returnTo
URL to the Allowed Logout URLs list in the Settings tab of the associated Auth0 application(s).
*
as a wildcard for subdomains (such as http://*.example.com
).client_id
parameter is included and the returnTo
URL is not set, the server returns the user to the first Allowed Logout URLs set in the Dashboard.
In order to avoid validation errors, make sure that you include the protocol part of the URL. For example, setting the value to *.example.com
will result in a validation error, so you should use http://*.example.com
instead.
oidc/logout
endpoint, read Use OIDC Endpoint to Log Users Out of Auth0.https://{yourDomain}/v2/logout?federated
You are responsible for ensuring your application terminates the user session before redirecting.
When the user reaches the /logout
endpoint, Auth0 terminates the Auth0 session, redirects the user to the logout endpoint, and terminates the session with the Identity Provider.
returnTo
parameter, the query string, and hash information provided as part of the URL are not taken into account.returnTo
parameter differently and for some it will not work. Please check your social provider’s settings to ensure that they will accept the returnTo
parameter and how it will behave.http://www.Example.Com/FooHoo.html
, the http://www.Example.Com
portion is case insensitive, while the FooHoo.html
portion is case sensitive.Client ID
and Secret
for these providers in the Dashboard for the logout to function properly.
returnTo
parameter to specify how to redirect the user after logout.
Not all IdPs support returnTo
.
For Facebook, the example code below uses the returnTo
parameter and specifies a website for the redirect.