Fix OIDC claims granting admin by default (#86)

* Fix OIDC documentation

Renaming userClaimsRules => claimMapping to match source code

* Updating Claim logic to add a basic 'truthy' check

If the Claim has a boolean result, check that it is true
If the Claim has a string result, check that it isn't empty
pull/99/head
Michael Robbins 3 years ago committed by GitHub
parent 1f219f49b5
commit 4e98f6ed7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -117,9 +117,11 @@ func (c *OIDCConfig) callbackHandler(runtime *authruntime.ProviderRuntime, oauth
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
if val, ok := result.(bool); ok {
// If result is 'false' or an empty string then don't include the Claim
if val, ok := result.(bool); ok && val {
claims.Add(claimName, strconv.FormatBool(val))
} else if val, ok := result.(string); ok {
} else if val, ok := result.(string); ok && len(val) > 0 {
claims.Add(claimName, val)
}
}

Loading…
Cancel
Save