[v11.0.x] JWT: Find login and email claims with JMESPATH (#86357)
JWT: Find login and email claims with JMESPATH (#85305)
* add function to static function to static service
* find email and login claims with jmespath
* rename configuration files
* Replace JWTClaims struct for map
* check for subclaims error
(cherry picked from commit e4250a72db)
Co-authored-by: linoman <2051016+linoman@users.noreply.github.com>
This commit is contained in:
co-authored by
linoman
parent
ca94886e18
commit
6f6667d89c
@@ -21,6 +21,8 @@ type AuthJWTSettings struct {
|
||||
AllowAssignGrafanaAdmin bool
|
||||
SkipOrgRoleSync bool
|
||||
GroupsAttributePath string
|
||||
EmailAttributePath string
|
||||
UsernameAttributePath string
|
||||
}
|
||||
|
||||
func (cfg *Cfg) readAuthJWTSettings() {
|
||||
@@ -43,6 +45,8 @@ func (cfg *Cfg) readAuthJWTSettings() {
|
||||
jwtSettings.AllowAssignGrafanaAdmin = authJWT.Key("allow_assign_grafana_admin").MustBool(false)
|
||||
jwtSettings.SkipOrgRoleSync = authJWT.Key("skip_org_role_sync").MustBool(false)
|
||||
jwtSettings.GroupsAttributePath = valueAsString(authJWT, "groups_attribute_path", "")
|
||||
jwtSettings.EmailAttributePath = valueAsString(authJWT, "email_attribute_path", "")
|
||||
jwtSettings.UsernameAttributePath = valueAsString(authJWT, "username_attribute_path", "")
|
||||
|
||||
cfg.JWTAuth = jwtSettings
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user