Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions docs/source/administrator/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ documentation in this project also.
[KeyCloak](https://www.keycloak.org) is an open source based provider of
identity management that you can host yourself. Below is an example on how you
can configure the GenericOAuthenticator class to authenticate against a KeyCloak
server (version 17 or later).
server (last tested with Keycloak 26).

To configure an OpenID Connect client, see [KeyCloak's own
documentation](https://www.keycloak.org/docs/latest/server_admin/index.html#_oidc_clients).
Expand All @@ -444,16 +444,32 @@ hub:
username_claim: preferred_username
userdata_params:
state: state
# In order to use keycloak client's roles as authorization layer
claim_groups_key: roles
allowed_groups:
allowed_users:
- user
admin_groups:
admin_users:
- admin
JupyterHub:
authenticator_class: generic-oauth
```

If you want to use Keycloak roles as JupyterHub groups for authorization you must create or modify a Keycloak scope mapper to return the roles, and ensure the mapper is returned in userinfo.
For example, if you modify the default Keycloak Client scope called `roles`:

```yaml
hub:
config:
GenericOAuthenticator:
scope:
- openid
- roles
auth_state_groups_key: oauth_user.realm_access.roles
manage_groups: true
allowed_groups:
- user
admin_groups:
- admin
```

### LDAP and Active Directory

```{warning}
Expand Down