Skip to content

Commit a558b5a

Browse files
authored
Updates documentation to address issues with logouts not persisting (#5)
1 parent 7fb892a commit a558b5a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

docs/AUTH0_SSO.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ In the application's **Settings** tab, scroll to **Application URIs** and set:
3131
| Field | Value |
3232
|-------|-------|
3333
| **Allowed Callback URLs** | `https://YOUR_DOMAIN/realms/opencase/broker/auth0/endpoint` |
34-
| **Allowed Logout URLs** | `https://YOUR_DOMAIN` |
34+
| **Allowed Logout URLs** | `https://YOUR_DOMAIN`, `https://YOUR_DOMAIN/realms/opencase/broker/auth0/endpoint/logout_response` |
3535
| **Allowed Web Origins** | `https://YOUR_DOMAIN` |
3636

3737
Replace `YOUR_DOMAIN` with your OpenCASE hostname (e.g. `opencase.1edtech.org`).
3838

39+
> The second logout URL is Keycloak's own broker callback, not the OpenCASE app itself. Keycloak's front-channel logout (see [Logout Settings](#logout-settings) below) redirects the browser to Auth0, and Auth0 needs to redirect it back to this exact Keycloak URL before Keycloak can finish logging the user out and return them to OpenCASE. Without it, Auth0 will reject the return redirect after processing the logout.
40+
3941
> The callback URL follows Keycloak's broker pattern: `/realms/{realm}/broker/{alias}/endpoint`. We'll use `auth0` as the alias in Step 2.
4042
4143
### Note Your Credentials
@@ -96,13 +98,16 @@ After entering the discovery endpoint, click outside the field -- Keycloak will
9698
9799
### Logout Settings
98100

99-
By default, logging out of OpenCASE only ends the Keycloak session -- the Auth0 session stays active. To propagate logouts to Auth0:
101+
By default, logging out of OpenCASE only ends the Keycloak session -- the Auth0 session stays active. If left this way, a user who logs out and then logs back in will be silently re-authenticated by Auth0 (skipping the credentials/password step entirely), because their Auth0 SSO cookie is still valid. To propagate logouts to Auth0:
100102

101103
1. Scroll to **Advanced settings** (or **OpenID Connect settings**)
102104
2. Set **Logout URL** to `https://YOUR_AUTH0_DOMAIN/oidc/logout` (may already be populated from the discovery endpoint)
103-
3. Enable **Backchannel logout**
105+
3. Enable **Store Tokens** (on the main provider settings page) -- this lets Keycloak attach the user's Auth0-issued ID token as `id_token_hint` when it logs them out of Auth0, so Auth0 can identify the exact session and end it silently instead of prompting for confirmation
106+
4. Leave **Backchannel logout** **disabled**
107+
108+
> **Do not enable Backchannel Logout here.** Despite the name, this setting makes Keycloak call Auth0's logout endpoint as a server-to-server backend request, not through the user's browser. Auth0 will report the call as successful, but it has no way to clear a cookie in a browser it never talked to -- the user's Auth0 session survives. Only the front-channel (browser-redirect) logout that happens when this is left disabled can actually clear the Auth0 SSO cookie.
104109
105-
Also ensure your Auth0 application has the correct **Allowed Logout URLs** (see Step 1).
110+
Also ensure your Auth0 application has the correct **Allowed Logout URLs**, including the Keycloak broker callback (see [Step 1](#configure-application-settings)).
106111

107112
### Click **Save**
108113

@@ -311,6 +316,10 @@ Set **Trust Email** to **On** in the Auth0 identity provider settings in Keycloa
311316

312317
Make sure the Auth0 identity provider is **Enabled** (toggle at the top of the IdP settings page in Keycloak).
313318

319+
### Logging out and back in skips the password prompt
320+
321+
If a user logs out of OpenCASE and immediately logging back in with the same account goes straight to the home page without ever showing Auth0's login form, the Auth0 SSO cookie in their browser is still valid -- see [Logout Settings](#logout-settings). This almost always means **Backchannel Logout** is enabled on the Auth0 IdP; disable it and confirm **Store Tokens** is enabled instead. Also double-check the Keycloak broker callback URL is present in Auth0's **Allowed Logout URLs** (see [Step 1](#configure-application-settings)) -- without it, Auth0 will reject the redirect back to Keycloak after processing the logout.
322+
314323
---
315324

316325
## Making Auth0 the Default Login (Optional)

0 commit comments

Comments
 (0)