Keycloak – SSO & Connector Permissions
Reference Environment: Keycloak Administration Console (Quarkus runtime, Keycloak 24.x–26.x as of late 2026).
Note for administrators: Since Keycloak 19+, the administration console runs on the modern Quarkus-based UI (replacing the legacy WildFly administration console). Navigation paths, dedicated client scopes, protocol mappers, token settings, and standard OIDC discovery endpoints (/realms/<realm-name>/.well-known/openid-configuration) described in this guide reflect this modern administration UI. If your organization operates Red Hat build of Keycloak (RHBK), the configuration steps and settings are functionally identical.
This guide provides a comprehensive, step-by-step walkthrough for administrators to set up Single Sign-On (SSO) with Keycloak for FSI Server, secure the integration using OpenID Connect (OIDC) with PKCE and confidential client authentication, and manage fine-grained access to different Source Connectors on FSI Server.
It covers architecture considerations, realm isolation, client configuration, protocol mappers for token claims, user federation (such as Active Directory / LDAP synchronization), identity brokering, and security hardening.
Realm Architecture: Master Realm vs. Dedicated Application Realm
Keycloak organizes users, credentials, roles, and clients into Realms. A realm manages a distinct set of users and applications, providing complete logical isolation:
| Feature | Master Realm | Dedicated Application Realm (e.g., fsi or corporate) |
|---|---|---|
| URL Pattern | https://<keycloak-domain>/realms/master | https://<keycloak-domain>/realms/<realm-name> |
| Primary Purpose | Keycloak system administration, super-admin accounts, and realm provisioning. | Isolating application users, groups, identity providers, and client configurations. |
| Recommendation | Never use for FSI Server. Reserved exclusively for Keycloak cluster management. | Recommended (Production Standard): Create a dedicated realm (e.g., fsi or your corporate realm). |
| OIDC Discovery Issuer URL | https://<keycloak-domain>/realms/master | https://<keycloak-domain>/realms/<realm-name> |
| User & Session Isolation | Global Keycloak admins only. | Dedicated user directory, custom session timeouts, and branded login theme. |
In the following steps, all configuration actions are performed inside your dedicated application realm (e.g., fsi).
Identity Directory Models: Local Groups vs. LDAP/AD Federation vs. Identity Brokering
Keycloak provides versatile options for managing directory identities and assigning group permissions:
| Capability | Keycloak Local Directory | LDAP / Active Directory Federation | Identity Brokering (Upstream IdP) |
|---|---|---|---|
| OIDC Single Sign-On (FSI Server) | ✅ Supported | ✅ Supported | ✅ Supported |
| Connector Access Control | ✅ Local Keycloak Groups | ✅ Synced via group-ldap-mapper | ✅ Mapped from upstream IdP claims |
| Group Membership Management | Manual assignment in Keycloak | ✅ Automated periodic / on-demand sync | ✅ Synchronized at login time |
| Client Authentication (BFF) | ✅ Confidential Client (Secret) | ✅ Confidential Client (Secret) | ✅ Confidential Client (Secret) |
| Token Group Filtering | ✅ Dedicated Client Scope | ✅ Dedicated Client Scope | ✅ Dedicated Client Scope |
| Multi-Factor Authentication (MFA) | ✅ Built-in (OTP / WebAuthn / Passkeys) | ✅ Built-in or delegated to AD | ✅ Delegated to upstream IdP |
| Back-Channel Single Logout (SLO) | ✅ Supported | ✅ Supported | ✅ Supported (if upstream supports SLO) |
| Token Path Customization | ✅ Group Name or Full Path | ✅ Group Name or Full Path | ✅ Group Name or Full Path |
Architecture & Data Flow
On FSI Server, digital assets are organized into Source Connectors (such as local storage directories, SAN/NAS shares, or cloud buckets). Access to each connector is governed by FSI Server Groups.
The following diagram illustrates how user attributes in Keycloak map to security groups, pass through the OIDC authorization code flow, and resolve to connector permissions on FSI Server:
Scenario Overview:
| FSI Connector | Purpose | Keycloak Group | Local Keycloak Setup | LDAP / Active Directory Setup | FSI Permission |
|---|---|---|---|---|---|
marketing-assets | Campaign images, graphics | fsi-marketing | Assigned in Keycloak group manager | Synced from CN=FSI-Marketing,OU=Groups,DC=... | Read, Write, Upload (rw) |
product-catalog | E-Commerce product photos | fsi-products | Assigned in Keycloak group manager | Synced from CN=FSI-Products,OU=Groups,DC=... | Read Only / Download (r) |
internal-archive | Confidential company archive | fsi-archive | Assigned with enforced MFA execution | Synced from CN=FSI-Archive,OU=Groups,DC=... | Read Only (r) |
| All Connectors | Full server administration | fsi-administrators | Assigned with WebAuthn/Passkey & OTP | Synced from CN=FSI-Admins,OU=Groups,DC=... | Administrator (Full access) |
Keycloak Administration Console Configuration
Step 1: Create or Select the Application Realm
- Log in to the Keycloak Administration Console (e.g.,
https://<keycloak-domain>/admin/). - Open the realm dropdown menu at the top of the left sidebar.
- Click Create Realm (or select your existing organizational realm, e.g.,
fsi). - Enter the Realm name: e.g.,
fsi. - Ensure Enabled is switched to ON.
- Click Create.
Keycloak automatically exposes its standard OIDC discovery configuration under:
https://<keycloak-domain>/realms/<realm-name>/.well-known/openid-configuration
FSI Server uses this endpoint to resolve authorization, token, JWKS, and logout URLs dynamically.
Step 2: Create Groups for Connectors
In the left navigation menu under your chosen realm, navigate to:
👉 Groups → Create group
- Create the groups corresponding to your connector permissions:
fsi-marketingfsi-productsfsi-archivefsi-administrators
- Click Create for each group.
Keycloak allows creating nested group structures (e.g., /fsi/marketing). By default, FSI Server expects clean group names matching your groupMapping keys. Keep your connector groups at the root level (or configure the protocol mapper as described in Step 6).
Step 3: Register and Configure the Client
- In the left navigation, navigate to:
👉 Clients → Create client - General settings:
- Client type:
OpenID Connect - Client ID:
fsi-server - Name:
FSI Server - Description:
FSI Server Media Platform Single Sign-On - Click Next.
- Client type:
- Capability config:
- Client authentication: ON (Mandatory: Configures Keycloak as a Confidential Client requiring a Client Secret).
- Authorization: OFF.
- Authentication flow:
- ☑ Standard flow (Authorization Code Flow)
- ☐ Direct access grants (Uncheck unless Resource Owner Password Credentials / ROPC is explicitly required)
- ☐ Implicit flow (Leave unchecked)
- ☐ Service accounts roles (Leave unchecked unless programmatic backend tokens are used)
- Click Next.
- Login settings:
- Root URL:
https://<fsi-domain> - Home URL:
https://<fsi-domain>/fsi/interface/ - Valid redirect URIs:
https://<fsi-domain>/fsi/interface/
(Example:https://fsi.example.com/fsi/interface/– Ensure the trailing slash/is included!) - Valid post logout redirect URIs:
https://<fsi-domain>/fsi/interface/ - Web origins:
+(or explicitlyhttps://<fsi-domain>)
- Root URL:
- Click Save.
FSI Server utilizes the Backend-for-Frontend (BFF) pattern: the browser receives a temporary authorization code from Keycloak and passes it to the Java backend. The backend exchanges the code for tokens server-to-server. Enabling Client authentication: ON ensures this exchange is authenticated using a secure Client Secret, preventing unauthorized token requests from untrusted clients.
Step 4: Configure Back-Channel Logout
To ensure that logging out from Keycloak or terminating an SSO session immediately invalidates the user's active session on FSI Server, configure Back-Channel Logout:
- In the client configuration of
fsi-server, navigate to the Advanced tab (or scroll down to Logout settings). - Configure the following fields:
- Frontchannel logout: Leave empty / disabled.
- Backchannel logout URL: Enter the FSI Server logout endpoint:
https://<fsi-domain>/service/oidc/logout - Backchannel logout session required: ON (enabled).
- Backchannel logout revoke offline sessions: OFF.
- Click Save.
When a session is revoked or the user logs out from Keycloak, Keycloak sends a signed HTTP POST request with a JWT logout_token to /service/oidc/logout. FSI Server's backend validates the signature, extracts the user/session identifier (sid / sub), and invalidates all corresponding Tomcat sessions immediately.
Step 5: Obtain the Client Secret
- In the client menu for
fsi-server, navigate to the Credentials tab. - Verify that Client Authenticator is set to Client Id and Secret.
- Copy the string in the Client secret field.
(If needed, you can regenerate this secret at any time using the regenerate button).
Step 6: Configure Token Group Claims (Protocol Mapper)
By default, Keycloak does not include user group memberships in the generated ID token. You must add a Group Membership Protocol Mapper to the client's dedicated scope:
- Navigate to:
👉 Clients →fsi-server→ Client scopes tab. - Click on the dedicated client scope link:
fsi-server-dedicated. - In the mappers list, click Add mapper → By configuration.
- Select Group Membership from the mapper types.
- Configure the mapper settings:
- Name:
groups - Token Claim Name:
groups - Full group path: OFF (Disabled – see tip below)
- Add to ID token: ON (Enabled – Critical: FSI Server reads groups from the ID token)
- Add to access token: ON (or OFF)
- Add to userinfo: ON
- Name:
- Click Save.
When Full group path is set to OFF (recommended), Keycloak emits clean group names in the ID token:
"groups": ["fsi-marketing", "fsi-administrators"]
If Full group path is left ON, Keycloak prepends a leading slash:
"groups": ["/fsi-marketing", "/fsi-administrators"]
If you keep Full group path enabled, you must include the leading slash / in your groupMapping keys in settings.yml (e.g., "/fsi-marketing": "marketing"). Setting it to OFF avoids this prefix requirement.
Step 7: Assign Users & Manage Federation
Option A: Local Keycloak Users
- In the left navigation, navigate to: 👉 Users → Add user.
- Fill in Username, Email, First name, and Last name.
- Under the Credentials tab, set a password for the user.
- Under the Groups tab, click Join Group and select the appropriate connector group (e.g.,
fsi-marketingorfsi-administrators).
Option B: Active Directory / LDAP User Federation
In enterprise deployments, Keycloak frequently synchronizes users and groups from Active Directory or OpenLDAP:
- Navigate to: 👉 User federation → Add provider → ldap.
- Configure connection settings, Bind DN, Users DN, and sync intervals.
- Once created, go to the Mappers tab of the LDAP provider and click Add mapper:
- Mapper type:
group-ldap-mapper - LDAP Groups DN:
OU=FSI Groups,DC=corp,DC=example,DC=com - Group Object Classes:
group(Active Directory) orgroupOfNames(OpenLDAP) - Mode:
READ_ONLY(orSYNC)
- Mapper type:
- Benefit: Enterprise Active Directory security groups are automatically mirrored into Keycloak groups, which FSI Server translates into connector access rules via
groupMappingwithout manual provisioning.
Option C: Multi-Factor Authentication (MFA / WebAuthn / Passkeys)
- Under Authentication → Flows, administrators can bind MFA policies (WebAuthn, Passkeys, Google Authenticator / FreeOTP) to the browser flow.
- Users logging into FSI Server are automatically prompted to complete MFA before Keycloak issues the authorization code.
Option D: Identity Brokering (Upstream Corporate IdP)
- If Keycloak acts as an identity broker for external IdPs (such as Okta, Google Workspace, or Ping Identity), navigate to Identity providers → select or add the upstream provider.
- Under the provider's Mappers tab, add a Claim to Group or Attribute to Group mapper to assign external directory users into Keycloak's
fsi-*connector groups automatically upon login.
FSI Server Configuration (settings.yml)
Configure the OIDC authentication module in settings.yml (located in the FSI Server configuration directory, e.g., /etc/fsi/fsi-server/config/settings.yml or ./config/settings.yml).
The example below shows all parameters, highlighting mandatory settings and default values:
authentication:
authModules:
- type: "oidc" # Mandatory: Module type
enabled: true # Default: true
name: "Keycloak (SSO)" # Display label on login button
provider: "keycloak" # Provider identifier
# 1. Credentials from Keycloak Client (Steps 3 & 5)
clientId: "fsi-server" # Mandatory: Client ID from Keycloak
clientSecret: "your-client-secret-from-keycloak" # Mandatory: Client Secret value
# 2. Issuer URL (Endpoints are automatically discovered via .well-known/openid-configuration)
# Mandatory: Keycloak Realm URL (https://<keycloak-domain>/realms/<realm-name>)
issuerUrl: "https://auth.example.com/realms/fsi"
# 3. Redirect URI
# Default: Uses base request URL if omitted.
# Recommendation: Specify explicitly with [IP_ADDRESS] to match Keycloak Valid Redirect URIs.
redirectUri: "https://[IP_ADDRESS]/fsi/interface/"
# 4. Token Claims
usernameClaim: "preferred_username" # Default: "preferred_username" (or "email")
groupsClaim: "groups" # Default: "groups"
# 5. User Provisioning & Session Mode
autoProvision: true # Default: true (provisions user upon first SSO login)
# 6. Group Mapping: Map Keycloak Group Names to FSI Server Groups
# Note: FSI Server groups must correspond to defined group names
groupMapping:
# Full Administrator (Access to server settings & all connectors)
"fsi-administrators": "administrators"
# Marketing Team (Mapped to marketing connector)
"fsi-marketing": "marketing"
# Products Team (Mapped to product catalog connector)
"fsi-products": "products"
# Archive Team (Mapped to internal archive connector)
"fsi-archive": "archive"
# Optional: File-based XML authentication module as local administrative fallback
- type: "file"
enabled: true
Troubleshooting & Common Issues
| Error Code / Symptom | Potential Root Cause | Resolution |
|---|---|---|
Invalid parameter: redirect_uri | 1. Trailing slash missing or mismatched. 2. Keycloak protocol (HTTP vs. HTTPS) mismatch behind reverse proxy. | 1. Ensure https://<domain>/fsi/interface/ has the exact same trailing slash / in both Keycloak Valid redirect URIs and settings.yml.2. If running Keycloak behind a reverse proxy (e.g., NGINX, Traefik, Envoy), verify proxy headers ( KC_PROXY_HEADERS=xforwarded or proxy=edge). |
unauthorized_client or Invalid client secret | Client secret mismatch or Client Authentication disabled. | 1. Verify that Client authentication is set to ON in Keycloak client settings. 2. Regenerate or re-copy the secret from the Credentials tab and update clientSecret in settings.yml. |
Token missing groups (groups claim absent) | Group Membership protocol mapper not added or not enabled for ID tokens. | In Keycloak, open Clients → fsi-server → Client scopes → <client-id>-dedicated. Verify that the Group Membership mapper exists and Add to ID token is set to ON. |
| User logs in successfully but sees no connectors | 1. Group name mismatch due to Full group path setting (/fsi-marketing vs. fsi-marketing).2. Group name in groupMapping does not match FSI Server group.3. User not assigned to group in Keycloak. | 1. If Full group path is ON in the mapper, update settings.yml keys to include leading / (e.g., "/fsi-marketing": "marketing"), or switch Full group path to OFF.2. Verify that the target group exists in FSI Server ( groups.yml).3. Verify user group membership in Keycloak Admin Console. |
| Back-Channel Logout does not terminate user session | 1. Network connectivity / firewall between Keycloak and FSI Server. 2. Self-signed or untrusted SSL certificate on FSI Server. 3. Backchannel logout URL misconfigured. | 1. Ensure the Keycloak container/host can resolve and reach https://<fsi-domain>/service/oidc/logout over HTTPS.2. If using internal PKI/self-signed certificates, ensure Keycloak trusts the certificate authority (Java truststore). 3. Verify that Backchannel logout session required is enabled in Keycloak client settings. |
PKIX path building failed: unable to find valid certification path | FSI Server Java backend does not trust the internal/self-signed SSL certificate of Keycloak. | Import your corporate CA certificate into the JVM truststore used by FSI Server (keytool -importcert -keystore $JAVA_HOME/lib/security/cacerts -file ca.crt). |
Mixed Content or SSL Redirect Loop | FSI Server or Keycloak behind SSL-terminating reverse proxy without forwarded headers. | Ensure reverse proxy passes X-Forwarded-Proto: https and X-Forwarded-Host: <domain> to both FSI Server and Keycloak. In Keycloak, set KC_HOSTNAME and KC_PROXY_HEADERS. |