Class InternalAuthenticationBackend
- java.lang.Object
-
- com.floragunn.searchguard.auth.internal.InternalAuthenticationBackend
-
- All Implemented Interfaces:
AuthenticationBackend,AuthorizationBackend,DynamicConfigFactory.DCFListener
public class InternalAuthenticationBackend extends Object implements AuthenticationBackend, AuthorizationBackend, DynamicConfigFactory.DCFListener
-
-
Constructor Summary
Constructors Constructor Description InternalAuthenticationBackend()
-
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.voidonChanged(ConfigModel cf, DynamicConfigModel dcf, InternalUsersModel ium)
-
-
-
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:AuthenticationBackendValidate 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 interfaceAuthenticationBackend- 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:AuthorizationBackendPopulate aUserwith backend roles. This method will not be called for cached users. Add them by calling eitheruser.addRole()oruser.addRoles()- Specified by:
fillRolesin interfaceAuthorizationBackend- 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.
-
onChanged
public void onChanged(ConfigModel cf, DynamicConfigModel dcf, InternalUsersModel ium)
- Specified by:
onChangedin interfaceDynamicConfigFactory.DCFListener
-
-