[v17] honor redirect to SAML SSO path if user is already authenticated #50442
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.
Manual backport of #50436 to branch/v17
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/sso
path, 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/web
path is preserved.changelog: updates the UI login redirection service to honor redirection to
enterprise/saml-idp/sso
path even if user is already authenticated with Teleport.