* Fix OAuth Source Edit Page to ensure restricted and group settings are set
* Also tolerate []interface in the groups
Fix #18432
Signed-off-by: Andrew Thornton <art27@cantab.net>
RequiredClaimName: form.Oauth2RequiredClaimName,
RequiredClaimValue: form.Oauth2RequiredClaimValue,
SkipLocalTwoFA: form.SkipLocalTwoFA,
+ GroupClaimName: form.Oauth2GroupClaimName,
+ RestrictedGroup: form.Oauth2RestrictedGroup,
+ AdminGroup: form.Oauth2AdminGroup,
}
}
switch rawGroup := claimValue.(type) {
case []string:
groups = rawGroup
+ case []interface{}:
+ for _, group := range rawGroup {
+ groups = append(groups, fmt.Sprintf("%s", group))
+ }
default:
str := fmt.Sprintf("%s", rawGroup)
groups = strings.Split(str, ",")