public class UserIdentityContext
extends Object
Stores identity/auth information for current requesting user. A new object created for each request.
Semantics of properties:
- basicCredentials: not null if a basic http auth header exists in the request. Being not-null does not mean being authenticated.
- oauthTokenString: contains the Bearer authorization header in the request. It's not necessarily authenticated.
- oauthToken: present if the oauthTokenString was present and verified.
- accountInfo: contains an authenticated account either using http authentication of Bearer token. If both headers
exist and are authenticated, basic-auth header is used to derive accountInfo.
- accountRoles: It contains the roles from the account as a set. It's not null only if accountInfo is not null. It can be empty
with valid accountInfo with null or empty 'roles' field.
- basicAuthHeader: Is set if the authorizationHeader was a basic-http-auth header. We keep it for ease of use so that we don't re-calculate it from basicCredentials if needed.
How to use it:
- check accountInfo to quickly decide if the request has been authenticated or not and an account is available.
- Author:
- Orestis Tsakiridis