fix: scope SSO auth detection to host and endpoint paths, document --safe-domain#1243
Merged
Conversation
The enterprise SSO matchers (Okta, OneLogin, SAML, SSO, ADFS) were tested against the entire URL, so ordinary pages such as /settings/sso/providers, a docs path like /docs/saml/overview, or a query string merely carrying an SSO URL were misclassified as authentication and had their navigation forced. Match identity providers on the hostname and SAML/SSO/ADFS on the pathname with endpoint-shaped patterns instead; the existing oauthPatterns are unchanged. Also document --safe-domain in the EN/CN CLI reference (host-bound semantics and precedence vs --internal-url-regex).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The enterprise SSO matchers used to keep sign-in flows in-app (Okta, OneLogin, SAML, SSO, ADFS) are tested against the entire URL. As a result, ordinary application pages are misclassified as authentication — their click handlers are stopped and navigation is forced. Examples:
/settings/sso/providers(a settings page)/docs/saml/overview(a docs page)https://app.example.com/?next=https://idp.example.com/sso/saml(an SSO URL carried in a query string)Changes
/saml/acs,/sso/redirect,/adfs/ls, …). Ordinary pages and query strings no longer trigger auth handling. The existingoauthPatternsare left unchanged.--safe-domain. Add it to the EN/CN CLI reference: host-bound semantics, precedence vs--internal-url-regex, and an example.Tests
Adds false-positive coverage (settings/docs paths, a query-carried SSO URL, a look-alike suffix host such as
okta.com.evil.test) alongside the existing provider/endpoint cases. Full Vitest suite passes; Prettier check clean.Test plan
SSO sign-in stays inside the app window. Navigating to an in-app
/settings/sso/...page now behaves normally instead of being hijacked as an authentication redirect.