1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-26 03:18:28 +00:00

Remove deprecated auth sources (#35272)

Entra ID users should use the OIDC oauth2 provider.

They will still be shown if the instance has a previous Azure AD source
configured.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
techknowlogick
2025-08-23 16:39:05 -04:00
committed by GitHub
parent e1fd9e3cd1
commit a2d88cd597
2 changed files with 44 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ func NewAuthSource(ctx *context.Context) {
ctx.Data["AuthSources"] = authSources
ctx.Data["SecurityProtocols"] = securityProtocols
ctx.Data["SMTPAuths"] = smtp.Authenticators
oauth2providers := oauth2.GetSupportedOAuth2Providers()
oauth2providers := oauth2.GetSupportedOAuth2ProvidersWithContext(ctx)
ctx.Data["OAuth2Providers"] = oauth2providers
ctx.Data["SSPIAutoCreateUsers"] = true
@@ -107,7 +107,9 @@ func NewAuthSource(ctx *context.Context) {
ctx.Data["SSPIDefaultLanguage"] = ""
// only the first as default
ctx.Data["oauth2_provider"] = oauth2providers[0].Name()
if len(oauth2providers) > 0 {
ctx.Data["oauth2_provider"] = oauth2providers[0].Name()
}
ctx.HTML(http.StatusOK, tplAuthNew)
}
@@ -240,7 +242,7 @@ func NewAuthSourcePost(ctx *context.Context) {
ctx.Data["AuthSources"] = authSources
ctx.Data["SecurityProtocols"] = securityProtocols
ctx.Data["SMTPAuths"] = smtp.Authenticators
oauth2providers := oauth2.GetSupportedOAuth2Providers()
oauth2providers := oauth2.GetSupportedOAuth2ProvidersWithContext(ctx)
ctx.Data["OAuth2Providers"] = oauth2providers
ctx.Data["SSPIAutoCreateUsers"] = true