Class InternalAuthenticationBackend
- java.lang.Object
-
- com.floragunn.searchguard.auth.internal.InternalAuthenticationBackend
-
- All Implemented Interfaces:
AuthenticationBackend,AuthorizationBackend,SyncAuthenticationBackend,SyncAuthorizationBackend
public class InternalAuthenticationBackend extends Object implements SyncAuthenticationBackend, SyncAuthorizationBackend
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInternalAuthenticationBackend.Factory-
Nested classes/interfaces inherited from interface com.floragunn.searchguard.auth.api.AuthenticationBackend
AuthenticationBackend.UserCachingPolicy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Userauthenticate(AuthCredentials credentials)Validate credentials and return an authenticated user (or throw an ElasticsearchSecurityException)booleanexists(User user)Lookup for a specific user in the authentication backendvoidfillRoles(User user, AuthCredentials credentials)Populate aUserwith backend roles.StringgetType()The type (name) of the authenticator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.floragunn.searchguard.auth.api.AuthenticationBackend
userCachingPolicy
-
Methods inherited from interface com.floragunn.searchguard.auth.api.SyncAuthenticationBackend
authenticate
-
Methods inherited from interface com.floragunn.searchguard.auth.api.SyncAuthorizationBackend
retrieveRoles
-
-
-
-
Method Detail
-
exists
public boolean exists(User user)
Description copied from interface:AuthenticationBackendLookup for a specific user in the authentication backend- Specified by:
existsin interfaceAuthenticationBackend- Parameters:
user- The user for which the authentication backend should be queried. If the authentication backend supports user attributes in combination with impersonation the attributes needs to be added to user by callinguser.addAttributes()- Returns:
- true if the user exists in the authentication backend, false otherwise. Before return call
user.addAttributes()as explained above.
-
authenticate
public User authenticate(AuthCredentials credentials)
Description copied from interface:SyncAuthenticationBackendValidate credentials and return an authenticated user (or throw an ElasticsearchSecurityException) Results of this method are normally cached so that we not need to query the backend for every authentication attempt.- Specified by:
authenticatein interfaceSyncAuthenticationBackend- Returns:
- the authenticated User, never null
-
getType
public String getType()
Description copied from interface:AuthenticationBackendThe type (name) of the authenticator. Only for logging.- Specified by:
getTypein interfaceAuthenticationBackend- Specified by:
getTypein interfaceAuthorizationBackend- Returns:
- the type
-
fillRoles
public void fillRoles(User user, AuthCredentials credentials) throws org.elasticsearch.ElasticsearchSecurityException
Description copied from interface:SyncAuthorizationBackendPopulate aUserwith backend roles. This method will not be called for cached users. Add them by calling eitheruser.addRole()oruser.addRoles()- Specified by:
fillRolesin interfaceSyncAuthorizationBackend- Parameters:
user- The authenticated user to populate with backend roles, never nullcredentials- Credentials to authenticate to the authorization backend, maybe null. This parameter is for future usage, currently always empty credentials are passed!- Throws:
org.elasticsearch.ElasticsearchSecurityException- in case when the authorization backend cannot be reached or thecredentialsare insufficient to authenticate to the authorization backend.
-
-