Security
Essencium supports three authentication methods that can be combined as needed:
- Local user database (username / password login) — always active
- External LDAP directory (username / password login) — optional
- External OAuth 2 provider (OpenID Connect flow) — optional
By default, an initial admin user is created with username devnull@frachtwerk.de and password adminAdminAdmin. Roles and rights are always managed in the local database, regardless of which authentication method is used.
Classes
-
WebSecurityConfig: Central Spring Security configuration. Defines which endpoints are protected, registers authentication providers, and sets up the JWT filter chain. -
JwtTokenAuthenticationFilter: A request filter that reads the JWT from theAuthorization: Bearerheader or the?t=query parameter, verifies its signature and session validity viaJwtTokenService, and passes the parsed claims downstream. -
JwtAuthenticationProvider: Receives the pre-validated claims from the filter and builds aUserDetailsobject from them. Does not perform signature verification or session checks — that responsibility belongs toJwtTokenAuthenticationFilter. -
DaoAuthenticationProvider: Handles local username/password logins by loading the user from the database and verifying the password hash. -
LdapAuthenticationProvider: Handles LDAP logins. Binds to the LDAP server with the user’s credentials and maps LDAP group memberships to application roles. -
OAuth2LoginAuthenticationProvider: Handles the OAuth 2 / OpenID Connect login flow, configured viahttp.oauth2Login(...)inWebSecurityConfig. After a successful redirect from the external provider, the user is looked up or created in the local database.
Password Strength
Local password strength is enforced via the zxcvbn library. The required strength level (1–4) is configured with app.security.min-password-strength; the default is 3. See the zxcvbn demo to understand how passwords are scored, and this article for the underlying approach.
JWT Tokens
Once a login succeeds, the system issues two tokens: a short-lived access token and a long-lived refresh token. Both are JWTs. Session tokens are stored server-side and looked up by their kid (key ID) claim on each request. Token lifetimes are configured with:
app.auth.jwt.access-token-expiration(default: 900 seconds / 15 minutes)app.auth.jwt.refresh-token-expiration(default: 2592000 seconds / 30 days)
Token Invalidation
Because session tokens are stored server-side, they can be explicitly revoked. Calling POST /v1/users/{id}/terminate deletes all stored session tokens for that user via JwtTokenService, immediately invalidating all active access and refresh tokens.
See the Authentication Guide for the API call details.
For configuration instructions, see the Authentication Guide.