Class InternalAuthenticationBackend

    • Method Detail

      • exists

        public boolean exists​(User user)
        Description copied from interface: AuthenticationBackend
        Lookup for a specific user in the authentication backend
        Specified by:
        exists in interface AuthenticationBackend
        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 calling user.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: SyncAuthenticationBackend
        Validate 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:
        authenticate in interface SyncAuthenticationBackend
        Returns:
        the authenticated User, never null
      • fillRoles

        public void fillRoles​(User user,
                              AuthCredentials credentials)
                       throws org.elasticsearch.ElasticsearchSecurityException
        Description copied from interface: SyncAuthorizationBackend
        Populate a User with backend roles. This method will not be called for cached users.

        Add them by calling either user.addRole() or user.addRoles()

        Specified by:
        fillRoles in interface SyncAuthorizationBackend
        Parameters:
        user - The authenticated user to populate with backend roles, never null
        credentials - 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 the credentials are insufficient to authenticate to the authorization backend.