You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-08-10 22:51:31 +02:00
Add keycloak-oidc provider based on OIDCProvider
This commit is contained in:
@@ -268,6 +268,19 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
|
||||
if len(o.KeycloakGroups) > 0 {
|
||||
p.SetAllowedGroups(o.KeycloakGroups)
|
||||
}
|
||||
case *providers.KeycloakOIDCProvider:
|
||||
if p.Verifier == nil {
|
||||
msgs = append(msgs, "keycloak-oidc provider requires an oidc issuer URL")
|
||||
}
|
||||
|
||||
// Backwards compatibility with `--keycloak-group` option
|
||||
if len(o.KeycloakGroups) > 0 {
|
||||
// Maybe already added with proper `--allowed-group` flag
|
||||
if !strings.Contains(o.Scope, " groups") {
|
||||
o.Scope += " groups"
|
||||
}
|
||||
p.SetAllowedGroups(o.KeycloakGroups)
|
||||
}
|
||||
case *providers.GoogleProvider:
|
||||
if o.GoogleServiceAccountJSON != "" {
|
||||
file, err := os.Open(o.GoogleServiceAccountJSON)
|
||||
@@ -286,10 +299,6 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
|
||||
case *providers.BitbucketProvider:
|
||||
p.SetTeam(o.BitbucketTeam)
|
||||
p.SetRepository(o.BitbucketRepository)
|
||||
case *providers.OIDCProvider:
|
||||
if p.Verifier == nil {
|
||||
msgs = append(msgs, "oidc provider requires an oidc issuer URL")
|
||||
}
|
||||
case *providers.GitLabProvider:
|
||||
p.Groups = o.GitLabGroup
|
||||
err := p.AddProjects(o.GitlabProjects)
|
||||
@@ -345,6 +354,10 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
|
||||
p.JWTKey = signKey
|
||||
}
|
||||
}
|
||||
case *providers.OIDCProvider:
|
||||
if p.Verifier == nil {
|
||||
msgs = append(msgs, "oidc provider requires an oidc issuer URL")
|
||||
}
|
||||
}
|
||||
return msgs
|
||||
}
|
||||
|
Reference in New Issue
Block a user