OAuth: Generic OAuth role mapping support (#17149)
Adds support for Generic OAuth role mapping. A new configuration setting for generic oauth is added named role_attribute_path which accepts a JMESPath expression. Only Grafana roles named Viewer, Editor or Admin are accepted. Closes #9766
This commit is contained in:
committed by
Marcus Efraimsson
parent
17f36d0492
commit
7a3d1c0e4b
@@ -184,7 +184,10 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) {
|
||||
}
|
||||
|
||||
if userInfo.Role != "" {
|
||||
extUser.OrgRoles[1] = m.RoleType(userInfo.Role)
|
||||
rt := m.RoleType(userInfo.Role)
|
||||
if rt.IsValid() {
|
||||
extUser.OrgRoles[1] = rt
|
||||
}
|
||||
}
|
||||
|
||||
// add/update user in grafana
|
||||
|
||||
Reference in New Issue
Block a user