-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: preserve saml idp redirect on device trust web auth #54530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
48982b0
e8ed498
69a7c87
08faf2f
0feb653
1115993
109a8b3
b387103
6ab8f45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |
| */ | ||
|
|
||
| const BASE_PATH = '/web'; | ||
| const SAML_SP_INITIATED_SSO_PATH = '/enterprise/saml-idp/sso'; | ||
| const SAML_IDP_INITIATED_SSO_PATH = '/enterprise/saml-idp/login'; | ||
|
Comment on lines
+20
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Looking at these, I might just keep a single definition with |
||
|
|
||
| /** | ||
| * Processes a redirect URI to ensure it's valid and follows the expected format. | ||
|
|
@@ -33,12 +35,11 @@ const BASE_PATH = '/web'; | |
| * @returns A processed URI string that always starts with the basePath, unless it's an invalid input. | ||
| * | ||
| * @example | ||
| * processRedirectURI('/web', null) // returns '/web' | ||
| * processRedirectURI('/web', 'https://example.com/path') // returns '/web/path' | ||
| * processRedirectURI('/web', '/custom/path') // returns '/web/custom/path' | ||
| * processRedirectURI('/web', '/web/existing/path') // returns '/web/existing/path' | ||
| * processRedirectURI('/web', 'invalid://url') // returns '/web' | ||
| * processRedirectURI('/app', 'https://example.com/path') // returns '/app/path' | ||
| * processRedirectURI(null) // returns '/web' | ||
| * processRedirectURI('https://example.com/path') // returns '/web/path' | ||
| * processRedirectURI('/custom/path') // returns '/web/custom/path' | ||
| * processRedirectURI('/web/existing/path') // returns '/web/existing/path' | ||
| * processRedirectURI('invalid://url') // returns '/web' | ||
| */ | ||
| export function processRedirectUri(redirectUri: string | null): string { | ||
| // should be equal to cfg.routes.root | ||
|
|
@@ -53,6 +54,13 @@ export function processRedirectUri(redirectUri: string | null): string { | |
| return path; | ||
| } | ||
|
|
||
| if ( | ||
| path.startsWith(SAML_IDP_INITIATED_SSO_PATH) || | ||
| path.startsWith(SAML_SP_INITIATED_SSO_PATH) | ||
| ) { | ||
| return path + url.search; | ||
| } | ||
|
|
||
| if (path === '/') { | ||
| return BASE_PATH; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.