Package de.businesscode.bcdui.subjectsettings.services


package de.businesscode.bcdui.subjectsettings.services
Authenticates a trusted backend caller acting on behalf of a BCD-UI user for a single request, with no browser session involved (e.g. a bot acting for a user, or an AI agent's MCP endpoint).

The two concerns are deliberately kept orthogonal:

  • RequestSession scopes the login limited to just the current request.
  • OnBehalfIdentityRealm decides who the caller may act as - a shared secret establishes client trust, then the asserted on-behalf identity is resolved to a BCD-UI user id.

The pieces:

  • RequestAuthenticationFilter - reads the request headers (client secret, asserted on-behalf idType/id) and reports the outcome as an HTTP status; Delegates the verification to the Realm.
  • RequestAuthenticationToken - the raw, not-yet-verified assertion built from those headers, passed to subject.login(token).
  • OnBehalfIdentityRealm - the Shiro Realm that verifies the shared secret and resolves the asserted identity to a BCD-UI user id.
  • UserIdResolver and DefaultUserIdResolver - pluggable resolution of the asserted identifying attribute to a technical user id.
  • RequestSession - binds the resulting Subject to the current thread and, on close(), destroys any session created along the way.
See RequestAuthenticationFilter's class javadoc for the shiro.ini configuration.