From 8c69b354b843ddcd73c506893ee425da8e46ef93 Mon Sep 17 00:00:00 2001 From: "pulse-triage[bot]" <249995291+pulse-triage[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 08:12:35 +0000 Subject: [PATCH] Explain how to check the saved OIDC callback The OIDC and reverse-proxy guides sent readers straight to a forwarded scheme header. First compare the existing provider callback with the identity provider registration, then identify whether a saved override or the public address owns it. Keep the working administrator login and proxy trust boundary intact. Contract-Neutral: Public and mirrored help plus an existing Help test; no sign-in, configuration, proxy trust or API behavior changes. Change-source: pulse-maintainer --- docs/OIDC.md | 25 ++++++++++++++++++- docs/REVERSE_PROXY.md | 3 ++- frontend-modern/public/docs/OIDC.md | 25 ++++++++++++++++++- frontend-modern/public/docs/REVERSE_PROXY.md | 3 ++- .../docs/__tests__/oidcSetupDocs.test.ts | 21 ++++++++++++++++ 5 files changed, 73 insertions(+), 4 deletions(-) diff --git a/docs/OIDC.md b/docs/OIDC.md index e30f8f22d9..cb4f097ed6 100644 --- a/docs/OIDC.md +++ b/docs/OIDC.md @@ -232,7 +232,7 @@ separate-session login and permission checks in Quick Start. | :--- | :--- | | **`invalid_id_token`** | Compare the configured issuer with the IdP issuer locally; use the existing redacted error, not a token dump or newly enabled Debug logs. | | **`unexpected signature algorithm "HS256"`** | Your IdP is signing with HS256. Configure it to use **RS256**. | -| **Redirect Loop** | Check `X-Forwarded-Proto` header (must be `https`) and cookie settings. | +| **Redirect Loop** | [Check the callback address](#check-the-callback-address) before changing proxy or cookie settings. | | **Self-Signed Certs** | The SSO provider form in Settings has no CA Bundle field. Set `oidc.caBundle` on the provider through the SSO provider API (`/api/security/sso/providers`) to a host path readable by Pulse (e.g. `/etc/ssl/certs/oidc-ca.pem` mounted into the container). For a provider configured with the legacy `OIDC_ENABLED` environment variables, set `OIDC_CA_BUNDLE` instead (see [Configuration](CONFIGURATION.md)). | ### Safe diagnosis @@ -330,3 +330,26 @@ save, [check the saved provider](#a-provider-change-could-not-be-confirmed) before writing anything. If the failure began after a save, keep the time, the setting you changed (or that nothing changed) and the locally redacted error. Do not repeat the save, rotate the secret or sign out to diagnose it. + +### Check the callback address + +Keep your working administrator session open. On your usual HTTPS Pulse +address, open **Settings → Security → Single Sign-On** and compare the saved +provider's **Callback / Redirect URL** with the redirect URL registered in +the identity provider. Match the whole address, including the scheme, host, +port if shown and provider-specific path. If only the registration is wrong, +correct it in the identity provider. There is no need to save the Pulse +provider again. + +If Pulse shows the wrong address, open the existing provider without saving +and check **Redirect URL**. A saved override takes precedence over **Public +URL** in **Settings → System → Network**. If there is no override, check +**Public URL** and the [trusted proxy setup](REVERSE_PROXY.md#before-configuring-the-proxy). +Adding `X-Forwarded-Proto: https` alone does not make Pulse trust the proxy. +Do not expose the backend or disable TLS or origin checks. After correcting +the address, register the exact callback shown on the card before trying a +fresh sign-in in a separate browser session. + +If the addresses already match, use the existing +[sign-in error to find the failing step](#safe-diagnosis). A redirect loop +alone does not tell you which setting is wrong. diff --git a/docs/REVERSE_PROXY.md b/docs/REVERSE_PROXY.md index 3689f1d87e..aa5eb56d16 100644 --- a/docs/REVERSE_PROXY.md +++ b/docs/REVERSE_PROXY.md @@ -169,5 +169,6 @@ HTTP/error status, not cookies, proxy secrets or a full network export. - **"Connection lost" (Workloads), "Disconnected", "Reconnecting...", "Sync reconnecting", "Backend healthy" or a stuck "Connecting to Pulse" screen:** separate the WebSocket upgrade from state delivery. If an already-observed upgrade failed through this proxy, check its `Upgrade` and `Connection` forwarding. An HTTP 101 or welcome message without subsequent state is a different failure; changing those headers is not an established remedy. Use the [stalled-dashboard guidance](TROUBLESHOOTING.md#health-is-green-but-the-dashboard-is-stalled), even if `/api/health` returns 200. Keep authentication, TLS and origin checks enabled; do not expose the backend to test a bypass. - **502 Bad Gateway**: Check Pulse's actual listener and the proxy's upstream address, port and network reachability; this does not by itself prove Pulse is stopped. Container `localhost` refers to that container, not another service. - **CORS Errors**: Do not add CORS headers in the proxy; Pulse handles them. Set **Settings → System → Network → Allowed Origins** or use `ALLOWED_ORIGINS` if needed. -- **OIDC redirects fail**: Ensure `X-Forwarded-Proto` is set (see above). +- **OIDC redirects fail**: [Check the saved callback address](OIDC.md#check-the-callback-address) + against the identity provider's registration before changing proxy headers. - **Wrong client IPs**: Check the immediate peer and header replacement above. Do not broaden proxy trust or change authentication to repair attribution. diff --git a/frontend-modern/public/docs/OIDC.md b/frontend-modern/public/docs/OIDC.md index e30f8f22d9..cb4f097ed6 100644 --- a/frontend-modern/public/docs/OIDC.md +++ b/frontend-modern/public/docs/OIDC.md @@ -232,7 +232,7 @@ separate-session login and permission checks in Quick Start. | :--- | :--- | | **`invalid_id_token`** | Compare the configured issuer with the IdP issuer locally; use the existing redacted error, not a token dump or newly enabled Debug logs. | | **`unexpected signature algorithm "HS256"`** | Your IdP is signing with HS256. Configure it to use **RS256**. | -| **Redirect Loop** | Check `X-Forwarded-Proto` header (must be `https`) and cookie settings. | +| **Redirect Loop** | [Check the callback address](#check-the-callback-address) before changing proxy or cookie settings. | | **Self-Signed Certs** | The SSO provider form in Settings has no CA Bundle field. Set `oidc.caBundle` on the provider through the SSO provider API (`/api/security/sso/providers`) to a host path readable by Pulse (e.g. `/etc/ssl/certs/oidc-ca.pem` mounted into the container). For a provider configured with the legacy `OIDC_ENABLED` environment variables, set `OIDC_CA_BUNDLE` instead (see [Configuration](CONFIGURATION.md)). | ### Safe diagnosis @@ -330,3 +330,26 @@ save, [check the saved provider](#a-provider-change-could-not-be-confirmed) before writing anything. If the failure began after a save, keep the time, the setting you changed (or that nothing changed) and the locally redacted error. Do not repeat the save, rotate the secret or sign out to diagnose it. + +### Check the callback address + +Keep your working administrator session open. On your usual HTTPS Pulse +address, open **Settings → Security → Single Sign-On** and compare the saved +provider's **Callback / Redirect URL** with the redirect URL registered in +the identity provider. Match the whole address, including the scheme, host, +port if shown and provider-specific path. If only the registration is wrong, +correct it in the identity provider. There is no need to save the Pulse +provider again. + +If Pulse shows the wrong address, open the existing provider without saving +and check **Redirect URL**. A saved override takes precedence over **Public +URL** in **Settings → System → Network**. If there is no override, check +**Public URL** and the [trusted proxy setup](REVERSE_PROXY.md#before-configuring-the-proxy). +Adding `X-Forwarded-Proto: https` alone does not make Pulse trust the proxy. +Do not expose the backend or disable TLS or origin checks. After correcting +the address, register the exact callback shown on the card before trying a +fresh sign-in in a separate browser session. + +If the addresses already match, use the existing +[sign-in error to find the failing step](#safe-diagnosis). A redirect loop +alone does not tell you which setting is wrong. diff --git a/frontend-modern/public/docs/REVERSE_PROXY.md b/frontend-modern/public/docs/REVERSE_PROXY.md index 3689f1d87e..aa5eb56d16 100644 --- a/frontend-modern/public/docs/REVERSE_PROXY.md +++ b/frontend-modern/public/docs/REVERSE_PROXY.md @@ -169,5 +169,6 @@ HTTP/error status, not cookies, proxy secrets or a full network export. - **"Connection lost" (Workloads), "Disconnected", "Reconnecting...", "Sync reconnecting", "Backend healthy" or a stuck "Connecting to Pulse" screen:** separate the WebSocket upgrade from state delivery. If an already-observed upgrade failed through this proxy, check its `Upgrade` and `Connection` forwarding. An HTTP 101 or welcome message without subsequent state is a different failure; changing those headers is not an established remedy. Use the [stalled-dashboard guidance](TROUBLESHOOTING.md#health-is-green-but-the-dashboard-is-stalled), even if `/api/health` returns 200. Keep authentication, TLS and origin checks enabled; do not expose the backend to test a bypass. - **502 Bad Gateway**: Check Pulse's actual listener and the proxy's upstream address, port and network reachability; this does not by itself prove Pulse is stopped. Container `localhost` refers to that container, not another service. - **CORS Errors**: Do not add CORS headers in the proxy; Pulse handles them. Set **Settings → System → Network → Allowed Origins** or use `ALLOWED_ORIGINS` if needed. -- **OIDC redirects fail**: Ensure `X-Forwarded-Proto` is set (see above). +- **OIDC redirects fail**: [Check the saved callback address](OIDC.md#check-the-callback-address) + against the identity provider's registration before changing proxy headers. - **Wrong client IPs**: Check the immediate peer and header replacement above. Do not broaden proxy trust or change authentication to repair attribution. diff --git a/frontend-modern/src/features/docs/__tests__/oidcSetupDocs.test.ts b/frontend-modern/src/features/docs/__tests__/oidcSetupDocs.test.ts index 666fe4369a..0de78d944f 100644 --- a/frontend-modern/src/features/docs/__tests__/oidcSetupDocs.test.ts +++ b/frontend-modern/src/features/docs/__tests__/oidcSetupDocs.test.ts @@ -107,6 +107,27 @@ describe('OIDC setup without losing access', () => { ); }); + it('routes OIDC and proxy readers to the same callback check before changing settings', () => { + const guide = article('OIDC'); + const fragment = 'check-the-callback-address'; + const heading = guide.querySelector(`h3[id="${fragment}"]`)!; + const oidcEntry = guide.querySelector(`tr a[href="#${fragment}"]`)!; + const proxyEntry = article('REVERSE_PROXY').querySelector(`a[href="/docs/OIDC#${fragment}"]`)!; + expect(oidcEntry.closest('tr')).toHaveTextContent('Redirect Loop'); + expect(proxyEntry.closest('li')).toHaveTextContent('OIDC redirects fail'); + + const compare = heading.nextElementSibling!; + const correct = compare.nextElementSibling!; + expect(text(compare)).toContain('Keep your working administrator session open'); + expect(text(compare)).toContain('correct it in the identity provider'); + expect(text(compare)).toContain('There is no need to save the Pulse provider again'); + expect(text(correct)).toContain('A saved override takes precedence over Public URL'); + expect( + correct.querySelector('a[href="/docs/REVERSE_PROXY#before-configuring-the-proxy"]'), + ).toHaveTextContent('trusted proxy setup'); + expect(correct.nextElementSibling!.querySelector('a[href="#safe-diagnosis"]')).not.toBeNull(); + }); + it('links all setup decisions to real focused documentation headings', () => { const guide = article('OIDC'); for (const [name, fragment] of [