Auth: Add skip_org_role_sync for Okta (#62106)
* WIP * Update pkg/services/login/authinfo.go * fix: merge * change order to internal last * adds: docs * add: configuration for defaults and sample * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Jo <joao.guerreiro@grafana.com> * Update docs/sources/setup-grafana/configure-grafana/_index.md Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --------- Co-authored-by: Jo <joao.guerreiro@grafana.com> Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
co-authored by
Jo
Christopher Moyer
parent
d7026900bd
commit
a232e7ceca
@@ -940,6 +940,21 @@ The following table shows the OAuth provider's setting with the default value an
|
||||
| GitLab | false | true | User organization roles are set with `defaultRole`, and the organization role can be changed for GitLab synced users. |
|
||||
| GitLab | true | true | User organization roles are set with `defaultRole` for GitLab. For other providers, the synchronization is skipped, and the org role can be changed, along with other OAuth provider users' org roles. |
|
||||
|
||||
### [auth.okta] skip_org_role_sync
|
||||
|
||||
When a user logs in the first time, Grafana sets the organization role based on the value specified in `AutoAssignOrgRole`. If you want to manage organization roles through Grafana's UI, set the `skip_org_role_sync` option to `true`.
|
||||
This also impacts `allow_assign_grafana_admin` setting, by not syncing the grafana admin role from GitLab.
|
||||
|
||||
> **Note:** There is a separate setting called `oauth_skip_org_role_update_sync` which has a different scope. While `skip_org_role_sync` only applies to the specific OAuth provider, `oauth_skip_org_role_update_sync` is a generic setting that affects all configured OAuth providers.
|
||||
|
||||
The following table shows the OAuth provider's setting with the default value and the skip org role sync setting.
|
||||
| OAuth Provider | `oauth_skip_org_role_sync_update` | `skip_org_role_sync` | Behavior |
|
||||
| --- | --- | --- | --- |
|
||||
| Okta | false | false | User organization roles are set with `defaultRole` and cannot be changed. |
|
||||
| Github | true | false | User organization roles are set with `defaultRole` for Okta, and Grafana Admins are set. For other providers, the synchronization is skipped, and the org role can be changed, along with other OAuth provider users' org roles. |
|
||||
| Okta | false | true | User organization roles are set with `defaultRole`, and the organization role can be changed for Okta synced users. |
|
||||
| Okta | true | true | User organization roles are set with `defaultRole` for Okta. For other providers, the synchronization is skipped, and the org role can be changed, along with other OAuth provider users' org roles. |
|
||||
|
||||
### api_key_max_seconds_to_live
|
||||
|
||||
Limit of API key seconds to live before expiration. Default is -1 (unlimited).
|
||||
|
||||
@@ -130,6 +130,17 @@ Example:
|
||||
role_attribute_path = contains(groups[*], 'admin') && 'GrafanaAdmin' || contains(groups[*], 'editor') && 'Editor' || 'Viewer'
|
||||
```
|
||||
|
||||
## Skip organization role sync
|
||||
|
||||
To prevent the sync of org roles from Okta, set `skip_org_role_sync` to `true`. This is useful if you want to manage the organization roles for your users from within Grafana.
|
||||
|
||||
```ini
|
||||
[auth.okta]
|
||||
# ..
|
||||
# prevents the sync of org roles from Okta
|
||||
skip_org_role_sync = true
|
||||
```
|
||||
|
||||
### Team Sync (Enterprise only)
|
||||
|
||||
Map your Okta groups to teams in Grafana so that your users will automatically be added to
|
||||
|
||||
Reference in New Issue
Block a user