Skip to navigation

Keycloak service accounts (unreleased)

A Keycloak client is now a service account only for an org listed in keycloak.serviceAccountOrgs, and only when it holds both PROVIDER_ADMIN and TENANT_ADMIN there. Previously, every client credentials token was a service account in every org, so a Tenant’s own client became its own Provider when it called GET /v2/org/{org}/nico/service-account/current.

Before upgrading

Service account orgs are required

With keycloak.serviceAccount: true, list the service account orgs in keycloak.serviceAccountOrgs, otherwise nico-rest-api fails to start. Disconnected mode allows exactly one org, such as ncx for the bundled ncx-service client. The helm-prereqs values already list it. Refer to Upgrading NICo for the values change.

Changed behavior

  • A client credentials token from a client that is not a service account is authorized by its roles in the requested org, like a user token. This includes keycloak.serviceAccount: false, where such a token previously got 401.
  • In disconnected mode, a config with more than one isServiceAccount: true claim mapping across custom issuers fails to start.
  • In connected mode, keycloak.serviceAccountOrgs can list more than one org, and custom issuer isServiceAccount mappings are accepted with no limit on their number.

New and changed configuration

SettingChange
keycloak.serviceAccountOrgsNew. Lists the only orgs whose clients can be service accounts. Required when keycloak.serviceAccount is true, with exactly one org in disconnected mode.
keycloak.serviceAccountNow requires keycloak.serviceAccountOrgs.
Custom issuer isServiceAccount and issuer serviceAccountNo longer limited to disconnected mode.