-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[org] Disallow logins with organizational Git Auth #16874
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 all commits
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 |
---|---|---|
|
@@ -110,6 +110,15 @@ export class Authenticator { | |
res.redirect(this.getSorryUrl(`Bad request: missing parameters.`)); | ||
return; | ||
} | ||
// Logins with organizational Git Auth is not permitted | ||
if (authProvider.info.organizationId) { | ||
log.info({ sessionId: req.sessionID }, `Login with "${host}" is not permitted.`, { | ||
"authorize-flow": true, | ||
ap: authProvider.info, | ||
}); | ||
res.redirect(this.getSorryUrl(`Login with "${host}" is not permitted.`)); | ||
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. Is there a better call to action we can include? What should the user do when this happens? 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. Great question. 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. I'm ok with this, given that it's a not a case a user can end up with in a regular case. ☁️ To better highlight this, we could also just return a |
||
return; | ||
} | ||
if (this.config.disableDynamicAuthProviderLogin && !authProvider.params.builtin) { | ||
log.info({ sessionId: req.sessionID }, `Auth Provider is not allowed.`, { ap: authProvider.info }); | ||
res.redirect(this.getSorryUrl(`Login with ${authProvider.params.host} is not allowed.`)); | ||
|
Uh oh!
There was an error while loading. Please reload this page.