Class LockAuditTokenService

java.lang.Object
io.jans.fido2.service.audit.LockAuditTokenService

@ApplicationScoped public class LockAuditTokenService extends Object
Obtains an OAuth2 access token, via the client credentials grant, for posting audit events to the Lock Server. Mirrors the pattern jans-lock's own TokenEndpointService uses for the same grant type against the same shared auth server, rather than introducing a new one.
  • Constructor Details

    • LockAuditTokenService

      public LockAuditTokenService()
  • Method Details

    • getAccessToken

      public String getAccessToken()
      Returns:
      a cached access token for LOCK_LOG_WRITE_SCOPE if one is still usable, or a freshly-issued one otherwise, or null if a token could not be obtained (missing/invalid config, or the token endpoint rejected the request). Never throws — the caller treats a null token as a delivery failure.

      Without this cache, every flush (every lockAuditFlushInterval, ~20s by default) issued a brand-new token — flagged in review on the PR that introduced this class.