Interface UserPassAuthenticator


  • public interface UserPassAuthenticator
    An authenticator used by BasicAuthSecurityFilter which can look up a user based on a username and password.
    • Method Detail

      • authenticate

        java.security.Principal authenticate​(java.lang.String username,
                                             java.lang.String password)

        Looks up a user.

        It is required that the user object implements the Principal interface, so if you have custom classes for users you may need to wrap them to include this.

        You can later get the principle from a SecurityContext (using the @Context annotation on a REST method) and cast SecurityContext.getUserPrincipal() to your custom class.

        Parameters:
        username - The username
        password - The password
        Returns:
        The user, or null if the credentials are invalid.