- Keycloak administrator access (to create a client) and DGTLMS administrator access.
- The URL of your Keycloak realm.
In Keycloak
Create a client
In your realm, create an OpenID Connect client (confidential type).
Enter the redirect URL
Add the DGTLMS return URL (shown by DGTLMS during configuration).
Get the credentials
Note the Client ID and the Client secret.
In DGTLMS
Open the configuration
Administration → Authentication configuration → Add an authentication mode → OAuth2 / OpenID Connect.Import the configuration
Paste your realm's discovery URL —
https://<keycloak>/realms/<realm>/.well-known/openid-configuration— then click Import. The endpoints (authorisation, token, userinfo, logout) are filled in automatically.Enter the client credentials
Enter the Client ID and Client secret obtained in Keycloak.
Check the attribute mapping
Make sure the email, last name and first name are mapped to the corresponding Keycloak fields.
Save and test
Confirm, then test the login from the login page.
Multi-profile users (learner and instructor…)
The same person can have several roles in DGTLMS (learner, instructor, custom level). With Keycloak, this works without any development — it is purely a matter of configuration:
Enable both options
in
Administration → Configuration: "Enable multi-profile users" (profile choice at login) and "Display profile selector" (switching during a session, at the top right). Leave the automatic login as a learner option disabled, otherwise the choice is bypassed.Align the username sent by Keycloak
DGTLMS links a person to their various profiles through the username stem (the username without the role suffix
_APP/_FOR…). The claim that Keycloak sends as the login must therefore match this stem (oftenpreferred_username), not necessarily the email address. If needed, add a Keycloak mapper that emits exactly this username. This is the only truly specific point to check — especially for your existing accounts ending in_FOR/_APP.Create the additional roles
a new, unknown user is automatically created as a learner. To give them a second role (e.g. instructor), an administrator adds the profile from their record: DGTLMS then automatically adds suffixes to the accounts (
_APP,_FOR…). The person will then see the choice at login and the selector during the session.
> The link to the Keycloak identity relies on the provider's stable identifier (the sub claim): it withstands email address changes and survives the addition of a role.
- The discovery URL must use HTTPS.
- Keycloak can also be connected via SAML, but OIDC is simpler thanks to the automatic import.
- The account must exist in DGTLMS (or be provisioned) for the login to succeed.