honor redirect to SAML SSO path if user is already authenticated#50436
Merged
flyinghermit merged 8 commits intomasterfrom Dec 20, 2024
Merged
honor redirect to SAML SSO path if user is already authenticated#50436flyinghermit merged 8 commits intomasterfrom
flyinghermit merged 8 commits intomasterfrom
Conversation
flyinghermit
commented
Dec 19, 2024
| expect(history.push).toHaveBeenCalledWith(samlIdPPath, true); | ||
| }); | ||
|
|
||
| it('non-base domain redirects with base domain for a matching "/enterprise/saml-idp/sso"', async () => { |
Contributor
Author
There was a problem hiding this comment.
We update any other domain to base domain. This test covers that scenario.
Though, this behavior does not sit well with me and I plan to do a followup on idea of rejecting non-base URL instead of replacing it with base URL.
kimlisa
approved these changes
Dec 19, 2024
r0mant
approved these changes
Dec 19, 2024
|
@flyinghermit See the table below for backport results.
|
This was referenced Jan 6, 2025
carloscastrojumo
pushed a commit
to carloscastrojumo/teleport
that referenced
this pull request
Feb 19, 2025
…vitational#50436) * redirect if path is saml idp sso path * fix test and add more tests * add login component tests * update test url path value * update test var name * rename non-base to base
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.
In authenticated session, we always used to redirect to root path
/web. This was done to prevent showing up Login form for users who are already authenticated but land on thehttps://proxy/web/login?redirect_uri=...path. This breaks SAML IdP service provider initiated SSO flow when user is already authenticated but is redirected to the root login page.This PR updates such redirection behaviour in the UI so that if user has a valid web session, and the redirection path matches
enterprise/saml-idp/ssopath, the UI will honor the redirection to let user continue with SAML SSO. For non-matching path, the existing behavior of redirecting to the root/webpath is preserved.changelog: updates the UI login redirection service to honor redirection to
enterprise/saml-idp/ssopath even if user is already authenticated with Teleport.