Skip to content

Configure Keycloak authentication methods

You’ll enable or disable the authentication methods available on the UDS Core login page — including username/password, X.509/CAC certificates, WebAuthn, OTP, and social login — using bundle overrides. No image rebuild is required.

  • UDS Core deployed
  • UDS CLI installed

UDS Core ships with all major authentication flows enabled by default. Use realmAuthFlows bundle overrides to selectively enable or disable them for your environment.

SettingDefaultDescription
USERNAME_PASSWORD_AUTH_ENABLEDtrueUsername/password login, password reset, and registration
X509_AUTH_ENABLEDtrueX.509 certificate (CAC/PIV) authentication
SOCIAL_AUTH_ENABLEDtrueSocial/SSO login (Google, Azure AD, etc.) — requires an IdP to also be configured
OTP_ENABLEDtrueOne-time password (TOTP) as a required MFA step for username/password login
WEBAUTHN_ENABLEDfalseWebAuthn/passkey as a required MFA step for username/password login
X509_MFA_ENABLEDfalseRequire additional MFA (OTP or WebAuthn) after X.509 authentication
  1. Determine which flows to enable

    Identify which authentication methods your environment requires. Common configurations:

    EnvironmentRecommended configuration
    CAC-only (no username/password)Disable USERNAME_PASSWORD_AUTH_ENABLED, keep X509_AUTH_ENABLED
    Username/password + OTP onlyKeep defaults, disable X509_AUTH_ENABLED and SOCIAL_AUTH_ENABLED
    Username/password + WebAuthnEnable WEBAUTHN_ENABLED, disable OTP_ENABLED if desired
    CAC + MFAEnable X509_MFA_ENABLED (also requires OTP_ENABLED or WEBAUTHN_ENABLED)
  2. Add realmAuthFlows to your bundle override

    In your uds-bundle.yaml, set the desired authentication flow values:

    uds-bundle.yaml
    packages:
    - name: core
    repository: registry.defenseunicorns.com/public/core
    ref: x.x.x-upstream
    overrides:
    keycloak:
    keycloak:
    values:
    - path: realmAuthFlows
    value:
    USERNAME_PASSWORD_AUTH_ENABLED: true
    X509_AUTH_ENABLED: false
    SOCIAL_AUTH_ENABLED: false
    OTP_ENABLED: true
    WEBAUTHN_ENABLED: false
    X509_MFA_ENABLED: false

    For clarity and auditability, specifying all settings explicitly is recommended — even settings you are leaving at their defaults.

  3. Create and deploy your bundle

    Terminal window
    uds create <path-to-bundle-dir>
    uds deploy uds-bundle-<name>-<arch>-<version>.tar.zst

Confirm authentication flow changes are applied:

  1. Navigate to sso.<domain>
  2. Confirm only the expected login options appear on the login page
  3. For X.509/CAC: confirm the browser prompts for a client certificate (requires truststore to be configured and a valid certificate installed)

Check Keycloak authentication flow configuration:

In the Keycloak admin UI, navigate to keycloak.<admin_domain>uds realm → AuthenticationFlows and confirm the expected flow steps are enabled or disabled.

Problem: Login page still shows disabled authentication options after deploy

Section titled “Problem: Login page still shows disabled authentication options after deploy”

Symptoms: The login page displays username/password or CAC fields even though they were disabled.

Solution: realmAuthFlows values are applied during initial realm import only. If Keycloak was already running before the override was applied, Keycloak must be fully torn down and redeployed so the realm is re-imported:

Terminal window
uds create <path-to-bundle-dir>
uds deploy uds-bundle-<name>-<arch>-<version>.tar.zst

If redeploying is not possible, configure the flows manually in the Keycloak Admin Console at keycloak.<admin_domain>uds realm:

Flow settingAdmin UI path
Disable username/passwordAuthenticationFlowsUDS Authentication → disable the Deny Access step below Username Password Form
Disable credential resetAuthenticationFlowsUDS Reset Credentials → disable the Reset Password step
Disable user registrationAuthenticationFlowsUDS Registration → disable the UDS Registration form step
Enable/disable OTPAuthenticationRequired Actions tab → toggle Configure OTP
Enable WebAuthn1. AuthenticationRequired Actions → toggle on Webauthn Register Passwordless under the Enabled column
2. AuthenticationFlowsUDS Authentication → set the MFA sub-flow to Required
3. Inside the MFA sub-flow, set WebAuthn Passwordless Authenticator to Required

Problem: X.509/CAC login fails with OCSP error in airgapped environment

Section titled “Problem: X.509/CAC login fails with OCSP error in airgapped environment”

Symptoms: Certificate authentication fails with an OCSP revocation check error. Logs show the OCSP responder is unreachable.

Solution: Configure OCSP fail-open behavior or disable OCSP checking via realmInitEnv.

To allow authentication when the OCSP responder is unreachable (fail-open):

- path: realmInitEnv
value:
X509_OCSP_FAIL_OPEN: "true"

To disable OCSP checking entirely:

- path: realmInitEnv
value:
X509_OCSP_CHECKING_ENABLED: "false"

If your environment uses CRL-based revocation instead of OCSP, configure the CRL path:

- path: realmInitEnv
value:
X509_CRL_CHECKING_ENABLED: "true"
X509_CRL_RELATIVE_PATH: "crls/DODROOTCA3.crl##crls/DODIDCA_81.crl" # Relative to /opt/keycloak/conf; use ## between multiple paths
X509_CRL_ABORT_IF_NON_UPDATED: "false" # Set true to fail authentication if CRL is expired

Problem: MFA is not required after enabling WebAuthn or OTP

Section titled “Problem: MFA is not required after enabling WebAuthn or OTP”

Symptoms: Users can log in without completing an MFA step.

Solution: Confirm that both the flow toggle and at least one MFA method are enabled. For WebAuthn to work as a required step, WEBAUTHN_ENABLED: true must be set; for OTP, OTP_ENABLED: true. Verify the realm was redeployed after the override was applied.

If you do need to require an additional factor after CAC authentication, use this configuration in the realmAuthFlows block from step 2 in place of the values shown there, then recreate and deploy the bundle:

- path: realmAuthFlows
value:
X509_AUTH_ENABLED: true
X509_MFA_ENABLED: true
OTP_ENABLED: true # At least one MFA method must also be enabled
WEBAUTHN_ENABLED: false

X509_MFA_ENABLED: true has no effect unless at least one of OTP_ENABLED or WEBAUTHN_ENABLED is also enabled.

These guides and concepts may be useful to explore next: