Keycloak
This guide provides the values needed for OpenID Connect (OIDC) Authentication using Keycloak. The steps should work for most deployments.
Note: You must be a realm admin in Keycloak in order to enroll MISP as a client.
Note: This guide is based on the Keycloak admin console in version 26.2.5 (May 2025).
You may wish to copy this table into a document to capture the required values as you go:
| Keycloak Name | Environment Variable | Value |
|---|---|---|
| Client ID | OIDC_CLIENT_ID |
|
| Client Secret | OIDC_CLIENT_SECRET |
|
| OpenID Endpoint Configuration (URL) | OIDC_PROVIDER |
Depending on your configuration, you may also need to set:
| Keycloak Name | Environment Variable | Value |
|---|---|---|
| Admin Role Name | OIDC_ADMIN_ROLE |
|
| Org Admin Role Name | OIDC_ORG_ADMIN_ROLE |
|
| Publisher Role Name | OIDC_PUBLISHER_ROLE |
|
| Read-Only Role Name | OIDC_READONLY_ROLE |
|
| Sync User Role Name | OIDC_SYNC_ROLE |
|
| User Role Name | OIDC_USER_ROLE |
1 - Switch Realms
After logging into the Keycloak admin console:
- Click Manage realms in the left hand menu.
- Click on the desired realm.
2 - Create Client
MISP needs to be added as an OIDC Client in Keycloak:
- Click Clients in the left hand menu.
- Click the Create client button.
- On the Create Client > General Settings screen:
- Set Client type to OpenID Connect.
- Set (and note) Client ID in line with local policies, e.g.
misp. - Optionally, set a friendly Name and Description.
- Optionally, enable Always display in UI, to show MISP in the Applications screen of the Keycloak user portal.
- Click Next.
- On the Create Client > Capability config screen:
- Enable Client authentication.
- Enable Authorization.
- In the Authentication flow section:
- Enable Standard flow.
- Disable Direct access grants.
- Click Next.
- On the Create Client > Login settings screen:
- Set Root URL to
https://{FQDN}[:{HTTPS_PORT}](e.g.https://misp.example.ac.uk). - Set Home URL to
/. - Set Valid redirect URIs to
/users/login. - Leave Valid post logout redirect URIs blank.
- Set Web origins to
+. - Click Save.
- Set Root URL to
3 - Configure Client
Some additional configuration is required for MISP to successful authenticate using this client.
- Go to the Client details screen.
- You should be redirected here after creating the client.
- You can get to this page via Clients > misp.
- In the Logout settings section, disable Front channel logout.
- Click Save.
- On the Credentials tab:
- Change Client Authenticator to Signed Jwt with Client Secret.
- Click Save then Yes.
- Click the View (eye) icon next to Client Secret and note the value.
- On the Roles tab:
- Click Create role.
- Set Role name to
misp-admin(can be different, overrideOIDC_ADMIN_ROLEas above). - Optionally, set Role description.
- Click Save.
- On the Role details screen, click Cancel to return to the Roles tab.
- Repeat for
misp-orgadmin(OIDC_ORG_ADMIN_ROLE),misp-publisher(OIDC_PUBLISHER_ROLE),misp-readonly(OIDC_READONLY_ROLE),misp-sync(OIDC_SYNC_ROLE), andmisp-user(OIDC_USER_ROLE).
- On the Client scopes tab:
- Click misp-dedicated (will be {Client ID}-dedicated if different Client ID was set).
- Click the Add predefined mapper button.
- Tick Client roles and click Add.
- Click client roles and in the next window:
- Set Client ID to
misp(or your chosen Client ID). - Set Token Claim Name to
roles. - Enable Add to ID token.
- Disable Add to access token.
- Click Save.
- Set Client ID to
- Click Dedicated scopes.
- On the Scope tab:
- Disable Full scope allowed.
- Click Client details (top of window).
- On the Advanced tab:
- In the Fine grain OpenID Connect configuration section:
- Optionally, set Logo URL to https://avatars.githubusercontent.com/u/4134875?s=128&v=4.
- Set Request object signature algorithm to HS256.
- Click this section's Save button.
- In the Advanced settings section:
- Set Proof Key for Code Exchange Code Challenge Method to S256.
- Click this section's Save button.
- In the Fine grain OpenID Connect configuration section:
4 - Assign User Roles
MISP users must be assigned to a role to be granted access:
- Go to the Users page (left hand menu).
- For each MISP user:
- Click on a user's username.
- On the Role mappings tab:
- Click Assign role.
- Ensure Filter by clients is selected.
- In Search by role name type misp (or the prefix you used for your roles) and click the search (arrow) icon.
- Tick the role to assign to this user, e.g.
misp-adminormisp-user. - Click Assign.
- Click Users to return to the user list.
- Repeat as needed for each user.
5 - OIDC Provider Metadata
MISP needs the OpenID Endpoint Configuration URL to authenticate users:
- Go to Realm settings in the left hand menu.
- Right click the link OpenID Endpoint Configuration and select the copy option.
- Note the URL; it is used as the
OIDC_PROVIDERenvironment variable.