Skip to main content

Realm Attributes

Realm attributes are key-value pairs stored on a realm. The Phase Two extensions use them for per-realm configuration: branding, Admin Portal visibility, IdP wizard behavior, organization settings, event listeners and email. Every key they read starts with _providerConfig..

This page lists all of those keys. Each one was checked against the source of the extension that reads it. Where another page explains a feature in more depth, the section links to it.

Setting attributes​

Attribute values are always strings. A boolean is the string true or false, and a number is its decimal form. An unset attribute takes the default shown in the tables below.

Admin UI​

Set the Admin theme (Realm settings > Themes) to phasetwo-ui and refresh the page. Realm settings then has an Attributes tab. The tab only shows keys that start with _providerConfig., and new or edited keys must use that prefix.

Most branding and portal keys also have a form in the Styles panel, and the organization keys have one under Organizations > Manage Settings. Prefer those forms where they exist, because they validate the values.

Admin REST API​

Attributes are part of the realm representation, so you can set them with the Keycloak Admin REST API, kcadm.sh or a realm import. A PUT that includes attributes replaces the realm's whole attribute map. Fetch the realm, merge your change into attributes, and put the result back:

curl -s -H "Authorization: Bearer $TOKEN" "$KC/admin/realms/$REALM" \
| jq '.attributes["_providerConfig.portal.org.events.enabled"] = "false"' \
| curl -s -X PUT -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d @- "$KC/admin/realms/$REALM"

Logo and icons​

These three keys are shared. Set them once and every surface that shows a logo uses them.

KeyValueDefaultRead by
_providerConfig.assets.logo.urlURLThe theme's bundled logoThemes (login and account pages), Admin Portal, IdP wizard
_providerConfig.assets.favicon.urlURLThe bundled faviconThemes, Admin Portal
_providerConfig.assets.appicon.urlURLThe bundled app iconThemes, Admin Portal (shown when the sidebar is collapsed)

Extensions: keycloak-themes, phasetwo-admin-portal, idp-wizard. More detail: Customizing the UI.

Brand tokens​

Extensions: keycloak-themes (the phasetwo-ui login theme and email templates) and phasetwo-admin-portal. More detail: Customizing the UI and Admin Portal configuration.

Each token is one attribute named _providerConfig.assets.theme.v2.<token>. The login theme, the Admin Portal and the email templates all read the same attributes.

A color token accepts a #rgb or #rrggbb hex value, a CSS color keyword, or a single rgb(), hsl(), hwb(), lab(), lch(), oklab() or oklch() function. A value in any other form is ignored. Every color token also has a dark-mode override named dark<Token>, for example _providerConfig.assets.theme.v2.darkBackground.

TokenLogin default (light / dark)Portal default (light / dark)
background#ffffff / #0a0a0a#ffffff / #09090b
foreground#0a0a0a / #fafafa#09090b / #fafafa
primary#3b82f6 / #3b82f6#1570c2 / #1570c2
primaryForeground#ffffff / #ffffff#ffffff / #ffffff
secondary#60a5fa / #1e3a5f#f4f4f5 / #27272a
secondaryForeground#0a0a0a / #fafafa#18181b / #fafafa
muted#f4f4f5 / #27272a#f4f4f5 / #27272a
mutedForeground#71717a / #a1a1aa#71717a / #a1a1aa
border#e4e4e7 / #3f3f46#e4e4e7 / #27272a

The remaining tokens have no fixed default:

TokenValueWhen unset
cardColorFollows background
cardForegroundColorFollows foreground
accentColorFollows muted
accentForegroundColorFollows foreground
inputColorFollows border
ringColorFollows primary
radiusCSS length0.625rem on login pages, 0.5rem in the portal
fontFamilyCSS font stackThe surface's own font stack

When primary or secondary is set and its dark override is not, dark mode uses the light value. When primaryForeground or secondaryForeground is unset and its background is set, a readable near-black or white is chosen. Email templates only use tokens you have set explicitly, and never the defaults above.

Login theme​

Extension: keycloak-themes. More detail: Customizing the UI.

These are the older login color keys. In the phasetwo-ui theme each one is the fallback for a brand token, used only when the matching theme.v2 attribute is unset.

KeyValueDefaultDescription
_providerConfig.assets.login.primaryColorColorNoneFallback for primary. Also sets the PatternFly primary and link colors
_providerConfig.assets.login.secondaryColorColorNoneFallback for secondary. Also sets the PatternFly hover colors
_providerConfig.assets.login.backgroundColorColorNoneFallback for background
_providerConfig.assets.login.primaryForegroundColorColorNoneFallback for primaryForeground
_providerConfig.assets.login.cssCSSNoneAppended to the login stylesheet after everything else

Each of the four color keys has a dark-mode form with a -dark suffix, such as _providerConfig.assets.login.primaryColor-dark. It is the fallback for the matching dark<Token> attribute.

Email​

Extension: keycloak-themes. More detail: Email.

KeyValueDefaultDescription
_providerConfig.assets.logo.base64Data URIThe Phase Two logoLogo for phasetwo-ui emails, for example data:image/png;base64,...
_providerConfig.assets.email.footer.line1TextThe realm's display nameFirst footer line
_providerConfig.assets.email.footer.line2TextNoneSecond footer line
_providerConfig.theme.email.templates.<template>Template sourceThe selected theme's templateOverrides one email template, for example ...templates.html/password-reset.ftl
_providerConfig.theme.email.messages.<message-key>TextThe theme's messageOverrides one message bundle entry used by email templates
_providerConfig.messages.email.<message-key>TextThe theme's messageOlder form of the key above. Still read. The theme.email.messages form wins if both are set
_providerConfig.theme.email.parentTheme namemustacheBase theme for the legacy attributes and attributes-v2 email themes

See Content templates for what a template override should contain.

Admin Portal​

Extension: phasetwo-admin-portal. More detail: Access control and Admin Portal configuration.

Visibility​

Each key shows or hides one part of the portal. The value must be exactly true to enable a section. Any other value disables it. User permissions still apply on top of these flags.

KeyDefaultControls
_providerConfig.portal.profile.enabledtrueThe whole profile section
_providerConfig.portal.profile.password.enabledtruePassword update
_providerConfig.portal.profile.twofactor.enabledtrueTwo-factor setup
_providerConfig.portal.profile.passwordless.enabledtruePasswordless (WebAuthn) credentials
_providerConfig.portal.profile.activity.enabledtrueDevice activity
_providerConfig.portal.profile.linked.enabledtrueLinked accounts. Also requires identity providers in the realm
_providerConfig.portal.org.enabledtrueThe whole organizations section
_providerConfig.portal.org.details.enabledtrueOrganization details
_providerConfig.portal.org.members.enabledtrueMembers list
_providerConfig.portal.org.invitations.enabledtrueInvitations
_providerConfig.portal.org.domains.enabledtrueDomains
_providerConfig.portal.org.sso.enabledtrueSSO setup. Requires the IdP wizard
_providerConfig.portal.org.events.enabledtrueEvents
_providerConfig.portal.org.attributes.enabledtrueOrganization attributes editor

Styles​

The portal takes its colors from the brand tokens and its logo from the shared logo keys. These keys are specific to the portal:

KeyValueDefaultDescription
_providerConfig.assets.portal.cssCSSNoneAppended after the generated variables, so it overrides them
_providerConfig.assets.portal.primaryColor700ColorNoneLegacy. Fallback for the primary token when theme.v2.primary is unset
_providerConfig.assets.portal.primaryColor100ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.primaryColor200ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.primaryColor400ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.primaryColor500ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.primaryColor600ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.primaryColor900ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.secondaryColor800ColorNoneLegacy. Read, but no longer affects rendering
_providerConfig.assets.portal.secondaryColor900ColorNoneLegacy. Read, but no longer affects rendering

IdP wizard​

Extension: idp-wizard. More detail: IdP Wizard and SSO wizards.

KeyValueDefaultDescription
_providerConfig.wizard.apiModeonprem or cloudonpremonprem uses the Keycloak Admin API, so the user needs realm-management roles. cloud uses the Organizations API, so the user needs organization roles
_providerConfig.wizard.versionv1 or v2The server default, v2 unless changedWhich wizard frontend to serve. An unrecognized value falls back to the server default
_providerConfig.wizard.auth-realm-overrideRealm nameThe current realmRealm the wizard authenticates against, when it differs from the realm being configured
_providerConfig.wizard.emailAsUsernameBooleanfalseMap the IdP email address to the Keycloak username when building mappers
_providerConfig.wizard.trustEmailBooleanfalseTurn on trust email in the identity provider the wizard creates
_providerConfig.wizard.usernameMapperImportBooleantrueUse IMPORT sync mode for the username mapper instead of INHERIT
_providerConfig.wizard.enableLdapBooleantrueOffer LDAP setup
_providerConfig.wizard.enableDashboardBooleantrueShow the dashboard of existing setup. Wizard v1 only
_providerConfig.wizard.enableGroupMappingBooleantrueRead and passed to the frontend, but currently has no effect
_providerConfig.wizard.appNameTextNoneProduct name shown by the wizard: in the page title in v1, and next to the logo in v2

The server default for version is set with --spi-realm-restapi-extension-wizard-default-version. The wizard's logo comes from _providerConfig.assets.logo.url.

Organizations​

Extension: keycloak-orgs. More detail: Organizations configuration.

The first seven keys can also be read and written together with GET and PUT /realms/{realm}/orgs/config, or under Organizations > Manage Settings in the Admin UI.

KeyValueDefaultDescription
_providerConfig.orgs.config.createAdminUserBooleantrueCreate a default admin user for each new organization. See Create admin user
_providerConfig.orgs.config.sharedIdpsBooleanfalseAllow one identity provider to be shared by several organizations. See Shared IdPs
_providerConfig.orgs.config.multipleIdpsBooleanfalseAllow an organization to have more than one active identity provider. See Multiple IdPs
_providerConfig.orgs.config.validateIdpBooleanfalseMark new organization identity providers as pending until validated. See Validate IdP
_providerConfig.orgs.portalLink.expirationInSecsInteger86400 (one day)Lifetime of a portal link, in seconds. See Portal link expiration
_providerConfig.orgs.config.defaultApplicationUriURLNoneLink used in invitation emails when the invitation has no redirect URI of its own
_providerConfig.orgs.config.scimEnabledBooleanfalseEnable SCIM for organizations. See SCIM
_providerConfig.orgs.defaults.syncModeSync modeFORCESync mode for identity providers created or linked through the Organizations API, when the request does not give one
_providerConfig.orgs.defaults.postBrokerFlowFlow aliaspost org broker loginPost-broker-login flow for identity providers created or linked through the Organizations API, when the request does not give one
_providerConfig.orgs.dnsRecordKeyDNS label_org-domain-ownershipLabel of the DNS record used to verify an organization domain. The record name is <label>.<domain>

Events​

Extension: keycloak-events. More detail: the keycloak-events README.

The script and HTTP listeners can run several instances per realm. Each instance is one attribute whose key ends in an index of your choosing, such as .0 or .1, and whose value is a JSON object. A listener only runs once it is also enabled under Realm settings > Events > Event listeners.

KeyValueDefaultDescription
_providerConfig.ext-event-script.<N>JSONNoneOne script for the ext-event-script listener. Fields: scriptName, scriptDescription, scriptCode
_providerConfig.ext-event-http.<N>JSONNoneOne target for the ext-event-http listener. targetUri is required. Optional fields cover HMAC signing and retry backoff
_providerConfig.ext-event-email.includedEventsEvent types separated by ##LOGIN_ERROR, UPDATE_CREDENTIAL, REMOVE_CREDENTIALEvent types for which the ext-event-email listener emails the user. Unknown types are skipped

Transactional email​

Extension: keycloak-transactional-email. More detail: its configuration reference, which lists the template names and the provider behavior.

KeyValueDefaultDescription
_providerConfig.ext-email-template.providerProvider IDNone, which disables the extensionOne of sendgrid, brevo, postmark, mailtrap, mailgun, customerio, resend, awsses
_providerConfig.ext-email-template.template.<name>Template IDNoneThe provider's template for one email type, such as template.password-reset. Add a .<locale> suffix for a locale-specific template
_providerConfig.ext-email-template.smtp.fromDisplayNameTextThe realm's SMTP "From display name"Sender display name. Takes an optional .<locale>, .<name> or .<name>.<locale> suffix to set it per locale, per template, or both
_providerConfig.ext-email-template.event-date-formatauto, dmy, mdy, ymd, or a date patternauto (locale-aware)Format of the event date in event notification emails

Each provider then has its own credential keys under _providerConfig.ext-email-template.<provider>.:

ProviderRequired keysOptional keysDefault api-url
sendgridapi-keyapi-urlhttps://api.sendgrid.com/v3/mail/send
brevoapi-keyapi-urlhttps://api.brevo.com/v3/smtp/email
postmarkserver-tokenapi-urlhttps://api.postmarkapp.com/email/withTemplate
mailtrapapi-tokenapi-urlhttps://send.api.mailtrap.io/api/send
mailgunapi-key, domainapi-urlhttps://api.mailgun.net/v3
customerioapi-keyapi-urlhttps://api.customer.io/v1/send/email
resendapi-keyapi-urlhttps://api.resend.com/emails
awssesaccess-key-id, secret-access-key, regionapi-urlThe SES endpoint for the configured region

Keys that are not read​

These keys appear in older documentation or sample realm exports, but no extension reads them. Setting them has no effect.

  • _providerConfig.wizard.enableDirectorySync
  • _providerConfig.wizard.enableIdentityProvider
  • _providerConfig.wizard.enableScim
  • _providerConfig.wizard.logoUrl. Use _providerConfig.assets.logo.url instead.