Ongoing OIDC: support to request additional OIDC scopes from the IdP (#1175)

This commit is contained in:
Jim authored and GitHub committed 2021-04-28 06:53:13 -04:00
1 parent a7ba27148b
commit 25e657fa51
36 files changed
+1432 -380

No files matched your search

@@ -13,6 +13,7 @@ type OidcAuthMethodAttributes struct {
CallbackUrl string `json:"callback_url,omitempty"`
IdpCaCerts []string `json:"idp_ca_certs,omitempty"`
AllowedAudiences []string `json:"allowed_audiences,omitempty"`
ClaimsScopes []string `json:"claims_scopes,omitempty"`
DisableDiscoveredConfigValidation bool `json:"disable_discovered_config_validation,omitempty"`
DryRun bool `json:"dry_run,omitempty"`
}
+24
View File
@@ -147,6 +147,30 @@ func DefaultAttributes() Option {
}
}
func WithOidcAuthMethodClaimsScopes(inClaimsScopes []string) Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]
if !ok {
raw = interface{}(map[string]interface{}{})
}
val := raw.(map[string]interface{})
val["claims_scopes"] = inClaimsScopes
o.postMap["attributes"] = val
}
}
func DefaultOidcAuthMethodClaimsScopes() Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]
if !ok {
raw = interface{}(map[string]interface{}{})
}
val := raw.(map[string]interface{})
val["claims_scopes"] = nil
o.postMap["attributes"] = val
}
}
func WithOidcAuthMethodClientId(inClientId string) Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]