public interface CacheableAuthInfo extends AuthInfo
This object can be cached by the Neo4j authentication cache.
This result type is used if you want Neo4j to manage secure hashing and matching of cached credentials. If you instead want to manage this yourself you need to use the separate interfaces AuthenticationPlugin and AuthorizationPlugin together with a CustomCacheableAuthenticationInfo result.
NOTE: Caching of authentication info only occurs if it is explicitly enabled by the plugin, whereas caching of authorization info (assigned roles) is enabled by default.
NOTE: Caching of the authorization info (assigned roles) does not require the use of a CacheableAuthInfo but will work fine with a regular AuthInfo.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
credentials()
Should return credentials that can be cached, so that successive authentication attempts could be performed
against the cached authentication info from a previous successful authentication attempt, without having to
call AuthInfo.getAuthInfo() again.
|
static CacheableAuthInfo |
of(Object principal,
byte[] credentials,
Collection<String> roles) |
Object |
principal()
Should return a principal that uniquely identifies the authenticated subject within this auth provider.
|
Object principal()
Typically this is the same as the principal within the auth token map.
principal in interface AuthInfoAuthToken.principal()byte[] credentials()
NOTE: The returned credentials will be hashed using a cryptographic hash function together with a random salt (generated with a secure random number generator) before being stored.
AuthToken.credentials(),
AuthPlugin.authenticateAndAuthorize(AuthToken)static CacheableAuthInfo of(Object principal, byte[] credentials, Collection<String> roles)
Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.