1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-10 22:51:31 +02:00

Extract roles from Keycloak Access Tokens

This commit is contained in:
Nick Meves
2021-03-14 18:32:24 -07:00
parent 07eb0efa6e
commit 3bda10f005
3 changed files with 94 additions and 3 deletions

View File

@@ -275,12 +275,13 @@ func parseProviderInfo(o *options.Options, msgs []string) []string {
// Backwards compatibility with `--keycloak-group` option
if len(o.KeycloakGroups) > 0 {
// Maybe already added with proper `--allowed-group` flag
// Maybe already added with `--allowed-group` flag
if !strings.Contains(o.Scope, " groups") {
o.Scope += " groups"
}
p.SetAllowedGroups(o.KeycloakGroups)
}
p.AddAllowedRoles(o.KeycloakRoles)
case *providers.GoogleProvider:
if o.GoogleServiceAccountJSON != "" {
file, err := os.Open(o.GoogleServiceAccountJSON)