WebJET CMS supports OAuth2/OIDC-based login for both the admin interface and the customer-facing zone. Users authenticate with an external identity provider. On first login a WebJET account is created automatically; on subsequent logins the account is updated.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/webjetcms/webjetcms/llms.txt
Use this file to discover all available pages before exploring further.
Configuration is read at startup. After changing any OAuth2-related configuration variable, restart the application server.
How it works
- A user clicks the OAuth2 login button on the login page.
- WebJET redirects to the identity provider’s authorization endpoint.
- After successful authentication, the provider redirects back to WebJET with a token.
- WebJET extracts the user’s email, name, and groups from the token.
- If no WebJET account exists for that email, one is created. If the account exists, it is updated.
- Group and rights assignments are synchronized (for configured providers).
Activating OAuth2
Set theoauth2_clients configuration variable to a comma-separated list of provider names you want to activate:
oauth2_clientsIncludeAdmin and oauth2_clientsIncludeUser must also be in oauth2_clients.
Predefined providers
For popular providers, onlyclientId and clientSecret are required.
Google
Facebook
GitHub
GitHub
Okta
Okta
oauth2_{provider}DefaultGroups sets the WebJET user group IDs (comma-separated) that are assigned to newly created users for that provider. These defaults apply only on first login; manual changes to the user’s groups are preserved on subsequent logins.
Custom providers (Keycloak and others)
For providers not on the predefined list, set all OAuth2 endpoints explicitly. The variable names are built from the provider name:Redirect URI
The redirect URI is automatically constructed for all providers:https://your-domain.com/login/oauth2/code/keycloak
Register this URI as an allowed redirect in your identity provider’s client configuration.
Token attributes
WebJET extracts the following attributes from the OAuth2/OIDC token:| Attribute | Required | Usage |
|---|---|---|
email | Yes | Identifies the user (must be unique) |
given_name | No | First name |
family_name | No | Last name |
preferred_username | No | Login name (default; configurable via oauth2_usernameAttribute) |
picture | No | Profile picture URL |
groups / roles / group_membership | No | Group list for synchronization |
realm_access.roles | No | Keycloak realm roles |
resource_access.<client>.roles | No | Keycloak client-specific roles |
Configuring the login name attribute
By default, the login name is taken frompreferred_username. To use a different attribute:
@ is used as a fallback.
Group and rights synchronization
By default, groups are not synchronized — only theDefaultGroups set at first login applies. To enable full group synchronization for a provider, add it to oauth2_clientsWithPermissions:
- Extracts group/role names from the token.
- Removes all existing group assignments for the user.
- Adds assignments for WebJET groups whose names match the token groups.
| Admin zone | Customer zone | |
|---|---|---|
| User groups synchronized | Yes | Yes |
| Permission groups synchronized | Yes | No |
| Admin flag set from groups | Yes | No |
| Admin rights required to log in | Yes | No |
Automatic admin rights
In the admin zone, a user is automatically granted admin rights if their OAuth2 groups include the group named inNTLMAdminGroupName:
Keycloak setup guide
Create a client
Under Clients → Create client:Save, then copy the Client secret from the Credentials tab.
- Client type: OpenID Connect
- Client ID:
webjetcms-client - Client authentication: ON (confidential)
- Standard flow: ON
- Direct access grants: OFF (recommended for production)
Create groups
Under Groups, create groups with the same names as your WebJET user groups and permission groups. For example:
webjet-admin— users who should receive admin rightseditors— content editors
Create token mappers
By default Keycloak does not include groups in the ID token. Add mappers in the client’s dedicated scope (Clients → your client → Client scopes → dedicated scope → Add mapper):Group Membership mapper:
- Token Claim Name:
groups - Full group path: OFF
- Add to ID token: ON
- Add to userinfo: ON
- Token Claim Name:
resource_access.webjetcms-client.roles - Add to ID token: ON
- Add to userinfo: ON
Configure WebJET
Set these configuration variables in Settings → Configuration:Restart the application server.
Troubleshooting
oauth2_email_not_found
oauth2_email_not_found
The provider did not return an email attribute. Check that:
- The user has an email address set in the provider.
- The
emailscope is included inoauth2_{provider}Scopes.
accessDenied
accessDenied
The user does not have admin rights after group synchronization. Check that:
NTLMAdminGroupNamematches the group name exactly.- The user is a member of that group in the provider.
- The group is included in the token (mapper is configured).
Groups do not synchronize
Groups do not synchronize
- Verify the provider is listed in
oauth2_clientsWithPermissions. - Confirm that group names in the provider exactly match WebJET group names.
- Enable DEBUG logging and check the logs for group extraction details.
Redirect URI mismatch
Redirect URI mismatch
The provider rejects the redirect URI. In the provider’s client configuration, add the exact redirect URI:For Keycloak in local development:
http://localhost/login/oauth2/code/keycloakLogin name is a UUID
Login name is a UUID
The
preferred_username attribute in the token contains an internal UUID. Set oauth2_usernameAttribute to a different attribute (e.g. customerNumber or identityName):Keycloak endpoints not reachable from WebJET server
Keycloak endpoints not reachable from WebJET server
The token URI, userinfo URI, and JWK Set URI require server-to-server connectivity. If WebJET runs in Docker, use
host.docker.internal instead of localhost in these URIs.