Ongoing OIDC: support to request additional OIDC scopes from the IdP (#1175)
This commit is contained in:
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"`
|
||||
}
|
||||
@@ -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"]
|
||||
|
||||
Reference in new issue
Block a user