Skip to content

Keycloak Realm Reference

Reference for the shared network realm. For how these pieces are used at request time, see Identity & Auth.

The realm name is per deployment. One realm serves one network or domain, and its name comes from KEYCLOAK_REALM — bluedots, yellowdots, purpledots. Examples below use bluedots; substitute your own.

The realm is defined as JSON and imported, not configured by hand. Signals keeps a template — infra/keycloak/realms/bluedots-realm.json in signals-dpg, infra/keycloak/realms/realm.json in aggregator-dpg — which render-realm.sh expands per deployment, stamping in the realm name and brand.

ClientVerticalKindPurpose
signals-uiSignalsPublicBrowser login for the Signals UI
signals-apiSignalsConfidentialThe API’s own Admin REST client
aggregator-portalAggregatorPublicBrowser login for the portal
aggregator-bffAggregatorConfidentialBFF → Aggregator API service account
aggregator-apiAggregatorConfidentialAggregator API
aggregator-dpgIntegrating DPGConfidentialAggregator → Signals
voice-dpgIntegrating DPGConfidentialVoice DPG → Signals

signals-api is intentionally accepted on neither the human nor the service path. It exists so the API can call Keycloak’s Admin REST endpoints, not so it can call itself.

RoleMeaning
signals_participantA person who can hold items and take actions
signals_adminAdministrative access to Signals
org_ownerParent-org owner; granted at org approval. Present even when ORG_HIERARCHY_ENABLED=false

At least one of these must be present on a human token — see KEYCLOAK_REQUIRED_REALM_ROLES.

Mappers are part of the realm import. They do not need to be added by hand.

ClaimOn clientCarries
aggregator_idaggregator-portalThe aggregator the user belongs to
aggregator_typeaggregator-portalAggregator classification
decision_madeaggregator-portalRegistration decision state
signalstack_org_idaggregator-portalThe upstream Signals organisation id
phone_numberaggregator-portal, signals-uiVerified phone number
phone_number_verifiedsignals-uiWhether the phone number is verified
signals_acting_orgssignals-ui, aggregator-dpg, voice-dpgOrganisations the token may act as

Each client also carries an audience mapper (signals-api-audience or aggregator-api-audience) so the receiving API can assert aud.

signals_acting_orgs supports a ['*'] wildcard grant, currently used for the platform network_service client. It is an explicit grant that should later be replaced by an enumerated organisation list.

Keycloak owns the login screen; neither app ships a login form.

  • A custom OTP authenticator (a Keycloak SPI, packaged as a provider JAR) sends a one-time code by email or SMS and verifies it.
  • FreeMarker themes under infra/keycloak/themes/otp/ render the login and email templates.
  • Themes are per-brand: blue-dot, purple-dot, orange-dot, upsdm and onetac each supply their own logos and favicon, so a deployment’s login page matches its network.
ScriptDoes
render-realm.shExpands the realm template for a deployment and writes the import file
apply-user-profile.shApplies the declarative user-profile configuration after import

See the Keycloak setup guide for the order to run these in.