You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-11-06 08:59:21 +02:00
Add support to ensure user belongs in required groups when using the OIDC provider
This commit is contained in:
@@ -152,6 +152,10 @@ func Validate(o *options.Options) error {
|
||||
}
|
||||
if o.Scope == "" {
|
||||
o.Scope = "openid email profile"
|
||||
|
||||
if len(o.AllowedGroups) > 0 {
|
||||
o.Scope += " groups"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,6 +283,7 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
|
||||
case *providers.OIDCProvider:
|
||||
p.AllowUnverifiedEmail = o.InsecureOIDCAllowUnverifiedEmail
|
||||
p.UserIDClaim = o.UserIDClaim
|
||||
p.GroupsClaim = o.OIDCGroupsClaim
|
||||
if o.GetOIDCVerifier() == nil {
|
||||
msgs = append(msgs, "oidc provider requires an oidc issuer URL")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user