usernameToken

Version

Verifies a wsse:UsernameToken in the inbound wsse:Security header against a pluggable {@link UserDataProvider} (the same abstraction basicAuthentication uses - a static list, an htpasswd file, JDBC, or LDAP), so hashed passwords (bcrypt, crypt(3), argon2id) are supported the same way they are there. When the token carries a wsu:Created/wsse:Nonce, this also rejects stale tokens and replayed nonces - the standard WS-Security anti-replay mechanism for UsernameToken. A missing or malformed token answers wsse:InvalidSecurityToken, a wrong or replayed credential wsse:FailedAuthentication. On success, the username is exposed to the rest of the exchange the same way a basicAuthentication login is, so user() in a later template or groovy step returns it.

wsse:Password of type PasswordDigest is not supported yet: verifying it requires the literal plaintext password on the gateway's side to recompute the digest, which a pluggable, hash-friendly provider cannot hand back out. A digest token is rejected with wsse:UnsupportedSecurityToken.

Syntax

usernameToken:
'$ref': <string>
cachingUserDataProvider: {}
customStatementJdbcUserDataProvider: {}
freshnessWindow: <string>
htpasswdFileProvider: {}
jdbcUserDataProvider: {}
ldapUserDataProvider: {}
staticUserDataProvider: {}
unifyingUserDataProvider:
- <userDataProviders>
usernameToken:
  '$ref': <string>
  cachingUserDataProvider: {}
  customStatementJdbcUserDataProvider: {}
  freshnessWindow: <string>
  htpasswdFileProvider: {}
  jdbcUserDataProvider: {}
  ldapUserDataProvider: {}
  staticUserDataProvider: {}
  unifyingUserDataProvider:
    - <userDataProviders>

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
freshnessWindowfalsePT5MTolerance, as an ISO-8601 duration, applied to a token's wsu:Created and to how long its wsse:Nonce is remembered for replay detection. Only checked when the token actually carries wsu:Created/wsse:Nonce. Nonces are remembered per gateway instance, so a replay is caught once per instance rather than across a cluster.-

Child Structure

ElementCardinalityDescription
cachingUserDataProvider0..1Caching User Data provider caches previous successful logins in order to make authentication faster
customStatementJdbcUserDataProvider0..1
htpasswdFileProvider0..1A user data provider utilizing htpasswd-style files.
jdbcUserDataProvider0..1
ldapUserDataProvider0..1A user data provider querying an LDAP server to authorize users and retrieve attributes.
staticUserDataProvider0..1A user data provider listing all user data in-place in the config file.
userDataProviders0..*

Can be used in