User session cookies options.
These options will be used for requests coming from browser devices.
CSRF header options.
CSRF will be validated when UserSessionOptions.deliveryOfJwtPayloadViaCookie has value true or when refresh token is sent to server.
This option is available only for requests coming from browser.
Lowercase name of the CSRF header.
Value of the the CSRF header.
This value will be used for comparison with the one from HTTP request.
In case they not match, an error is thrown and request will be aborted.
This option kicks in only when requests are made from browser devices.
Depending on the provided value, the following behaviours will happen:
header.payload
to be sent via {@link UserSessionCookiesOptions.name.payload} cookie. header.payload
to be sent to client via {@link UserSessionOptions.headers.access} header. Bearer ${header.payload}
value.Notice that on requests made from browsers, JWT signature will always be sent via {@link UserSessionCookiesOptions.name.signature} cookie, no matter of the value for this option.
HTTP headers used for passing Access & Refresh tokens.
This option will be used for requests coming from non-browser devices.
Lowercase name of header in the HTTP response which will contain Access Token.
This header name will be used in the following situations:
- when sending Access Token after creating session
- when sending Access Token after renewing session
- when sending JWT payload
to browser clients which won't send CSRF header, as they usually store payload
in localStorage.
Notice that on further subsequent requests, not matter of the situations above, Access Token (or it's payload part) will need to be included in the Authorization header.
Lowercase name header in the HTTP response which will contain Refresh Token.
Notice that renew and delete session HTTP requests will need to include
header with this name containing Refresh Token.
Whether to set Cache-Control: no-cache="Set-Cookie, Set-Cookie2" response header for the requests that deliver access and refresh tokens to client (i.e. JwtUserSessionMiddleware.create and JwtUserSessionMiddleware.refresh operations).
This option is available only for requests coming from browser.