Dependencies
provided in the WebAdmin starter, so include it explicitly.
Configuration
Enable the mode, then configure the OAuth2 client with standard Spring Security OAuth2 properties. The example below mirrors the demo’s Keycloak setup (realmaseeflow, externalized under a keycloak: block so the URLs and client secret can be overridden with environment variables):
keycloak registration/provider IDs are arbitrary labels — use whatever matches your provider. The realm here is aseeflow; change it to your own realm.
These values are for local testing — a Keycloak at
localhost:9000 and the demo aseeflow realm and client. For production, point at your own provider and realm, and supply the client secret via an environment variable. See Security./engine-rest activates only when spring.security.oauth2.resourceserver.jwt.issuer-uri is set (the resourceserver block above) — omit that block to make REST session-only (the SPA still works over the SSO session). The group-name-attribute claim usually has to be added on the provider so it appears in the token.
How it works
Unauthenticated UI requests are redirected to the provider; after login, the login session authorizes subsequent UI and REST requests. REST endpoints (/engine-rest/**) are always protected. Logout is handled by the provider’s logout flow.
On Tomcat and WildFly the UI calls the REST API that WebAdmin serves itself, at /webadmin/engine-rest, with the same login session. WebAdmin doesn’t need the separate Engine REST application at /engine-rest to be configured for OAuth2: that configuration only protects the API for your own programs — see Production hardening.
A WebAdmin session lasts until its own timeout. WebAdmin doesn’t end it when the provider ends the user’s session there.
When to use it
OAuth2 suits enterprise applications with centralized identity management and integration with providers such as Keycloak, Auth0, or Okta. For deep Keycloak integration with user/group synchronization, use Keycloak authentication instead.Properties
Login behavior and REST token validation derive from the standard
spring.security.oauth2.client.registration.<id>.* and spring.security.oauth2.client.provider.<id>.* properties — see the Spring Boot OAuth2 reference for the full set.