SSO Configuration via ADFS
Prerequisites
Required:
- Microsoft Windows Server 2019 with AD and AD FS configured
- YuChat Keycloak server (included in delivery)
HTTPS Configuration:
- AD FS:
https://fs.domain.com - YuChat Keycloak:
https://kc-yuchat.domain.com
Global certificates are required for both AD FS and Keycloak.
We recommend using a dedicated Keycloak realm for AD FS SSO authorization.
Configuring AD FS
AD FS serves as the trusted identity provider. Keycloak connects as an OAuth 2 client.
Create Application Group
- In AD FS, open Application Groups → right-click → Add Application Group
Adding server application to AD FS

-
Configure with these settings:
- Client Identifier:
keycloak - Redirect URI:
https://kc-yuchat.domain.com/auth/realms/yuchat/broker/ADFS/endpoint(adjust realm name as needed) - Credentials: Generate a shared secret — save it for later
- Client Identifier:
-
Complete the wizard. The keycloak application appears in the Application Groups folder.
Application group created

Create API
- Double-click keycloak in Application Groups → Add application
Adding API to AD FS

- Configure:
- Name:
keycloak - API - Identifier:
keycloak(must match Client Identifier above) - Access control policy: Permit everyone
- Permitted scopes: Select allatclaims and openid
- Name:
The allatclaims scope copies all access token fields to the ID token for Keycloak.
API configuration complete

Configure Claim Mappings
Required fields for YuChat: email, given_name, family_name
- Open the keycloak application → double-click keycloak - Web API
- Go to Issuance Transform Rules → Add Rule
- Select template: Send LDAP Attributes as Claims
Configure:
- Claim rule name:
Attributes - Attribute store: Active Directory
- Mappings:
- E-Mail-Addresses →
email - Given-Name →
given_name - Surname →
family_name
- E-Mail-Addresses →
The fields email, given_name, family_name must be entered manually — they don't appear in the dropdown.
Claim mapping configuration

Configuring Keycloak
Import AD FS as Identity Provider
- In Keycloak, select your realm → Identity Providers → Add OpenID Connect v1.0
Adding OpenID provider to Keycloak

- Get the discovery endpoint URL:
curl https://fs.domain.com/adfs/.well-known/openid-configuration
-
Configure:
- Alias:
ADFS(used in redirect URL) - Discovery endpoint: Your AD FS OpenID configuration URL
- Client ID:
keycloak(must match AD FS Client Identifier) - Client Secret: The secret generated in AD FS
- Alias:
-
Save, then reopen and set:
- Disable User Info: ON
-
Verify the Redirect URI matches AD FS configuration
Configure Attribute Mapping
- Open the ADFS identity provider → Mappers tab
- Add three rules using Attribute Importer type:
| Claim | User Attribute |
|---|---|
| given_name | firstName |
| family_name | lastName |
Keycloak attribute mappers

Transparent SSO
Enable automatic redirection to AD FS login.
- Go to Authentication
- Duplicate the browser flow → name it
yuchat-adfs-flow - Configure Identity Provider Redirector:
- Click the gear icon
- Set Default Identity Provider to your ADFS alias
Identity provider redirector

The Default Identity Provider field is case-sensitive. It must exactly match the Alias.
- Set Identity Provider Redirector to Required
- Remove "Username, password, otp and other auth forms" from the flow
Browser authentication flow

With transparent SSO, clicking "Login via SSO" in YuChat redirects directly to AD FS. Users already authenticated (e.g., via Outlook Web) enter YuChat immediately.
Combining SSO with Workspace Sync
To use SSO together with automatic workspace assignment, add LDAP user migration to the same Keycloak realm.
Configure attribute mapping at the LDAP level, not the identity provider level.
Configuration Steps
- Configure LDAP user migration with attribute mapping
Ensure LDAP and Identity Provider configurations use consistent username and email field mappings.
- In Keycloak → Authentication, create a new flow:
- Name:
First login link - Add steps:
- Detect existing broker user (Required)
- Automatically set existing user (Required)
- Name:
First login link flow

- Update your ADFS identity provider:
- Set First login flow override to
First login link - Set Sync mode to Import
- Set First login flow override to
After configuration, verify that:
- All LDAP users appear in Keycloak's Users tab
- SSO login creates an "Identity provider links" entry connecting the AD FS identity to the LDAP user