Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

soap: Fix auto-redirect to IdP when SOAP is enabled#64184

Merged
eseliger merged 1 commit into
mainfrom
es/07-31-soapfixauto-redirecttoidpwhensoapisenabled
Jul 31, 2024
Merged

soap: Fix auto-redirect to IdP when SOAP is enabled#64184
eseliger merged 1 commit into
mainfrom
es/07-31-soapfixauto-redirecttoidpwhensoapisenabled

Conversation

@eseliger

@eseliger eseliger commented Jul 31, 2024

Copy link
Copy Markdown
Member

When exactly 1 auth provider is configured, Sourcegraph redirects users automatically to the IdP to speed up the sign-in process, so that users don't have to make an extra click to select the one and only sign-in provider.

SOAP is a special case though because it is hidden by default, but enabled on all cloud instances. That caused this auto redirect to never fire for Cloud, since there are technically two auth providers.

This PR fixes it by checking for the sourcegraph-operator query parameter which tells the UI to show the magic SOAP auth provider in the list.

Closes SRC-500

Test plan: Tested on a cloud instance that indeed there is no auto redirect. Then tested locally with SOAP configured that auto redirects happen after this PR, and that there is no auto redirect when the ?sourcegraph-operator query parameter is set.

Changelog

When only a single auth provider is configured, users are again redirected correctly to the identity provider on Sourcegraph Cloud.

When exactly 1 auth provider is configured, Sourcegraph redirects users automatically to the IdP to speed up the sign-in process, so that users don't have to make an extra click to select the one and only sign-in provider.

SOAP is a special case though because it is hidden by default, but enabled on all cloud instances. That caused this auto redirect to never fire for Cloud, since there are technically two auth providers.

This PR fixes it by checking for the sourcegraph-operator query parameter which tells the UI to show the magic SOAP auth provider in the list.

Closes SRC-500

Test plan: Tested on a cloud instance that indeed there is no auto redirect. Then tested locally with SOAP configured that auto redirects happen after this PR, and that there is no auto redirect when the ?sourcegraph-operator query parameter is set.
@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2024
@github-actions

Copy link
Copy Markdown
Contributor

💡 Learn more about each section: PR description tips, Test Plan and Changelog.

@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels Jul 31, 2024

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @eseliger and the rest of your teammates on Graphite Graphite

@eseliger eseliger marked this pull request as ready for review July 31, 2024 11:54
@eseliger eseliger requested a review from a team July 31, 2024 11:54
@eseliger eseliger merged commit eb5a0d1 into main Jul 31, 2024
@eseliger eseliger deleted the es/07-31-soapfixauto-redirecttoidpwhensoapisenabled branch July 31, 2024 18:27
@vovakulikov

Copy link
Copy Markdown
Contributor

@eseliger, sorry to bother you, but do you think this change could cause an auth requirement on dotcom?

vovakulikov added a commit that referenced this pull request Aug 2, 2024
sqs referenced this pull request Aug 2, 2024
Reverts sourcegraph/sourcegraph#64184

The sourcegraph/sourcegraph#64184 is probably caused auth redirect on
dot com. Revert it while we're fixing the original problem

## Test plan

CI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants