This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Allow sign-in providers for permissions use only#60722
Merged
Merged
Conversation
eseliger
reviewed
Mar 11, 2024
eseliger
left a comment
Member
There was a problem hiding this comment.
This should probably apply to all provider types, not just OAuth
…/60615-allow-non-sign-in-auth-provider
…/60615-allow-non-sign-in-auth-provider
Contributor
Author
|
@eseliger the non-OAuth checks are handled in their own middleware, like for SAML: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@8ab60e39b0f9e31dd82886bde7e3f5516252d462/-/blob/cmd/frontend/internal/auth/saml/middleware.go?L60-72 |
Member
|
aha! that's interesting(read: a little confusing), but also probably fine :D |
eseliger
approved these changes
Mar 14, 2024
|
|
||
| type authProviderInfo struct { | ||
| IsBuiltin bool `json:"isBuiltin"` | ||
| NoSignIn bool `json:"noSignIn"` |
Member
There was a problem hiding this comment.
I think we'd want to add that to the jscontext type definition on the JS side, to stay consistent.
Contributor
Author
There was a problem hiding this comment.
Ah sorry, this was WIP, should have marked it as draft again
Contributor
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #60615
The check that determines whether or not to auto-redirect to the auth provider does not take into account whether or not the auth provider is marked as hidden or not.
This PR fixes that so that if an auth provider his hidden, it is not factored into the decision of whether or not the user should be auto-redirected to the auth provider.
So now, if you have two auth providers configured:
{ "auth.providers": [ { "type": "github", "hidden": true }, { "type": "gitlab" } ] }you would be auto-redirected to the GitLab sign-in page when visting
/sign-inon SourcegraphFurthermore, this PR also adds a new config option,
noSignIn, that allows an auth provider to be only hidden from the sign-in page (hiddenhides it from the sign-in and account security page).Test plan
Existing tests pass.