Package io.muserver.rest
Interface UserPassAuthenticator
-
public interface UserPassAuthenticator
An authenticator used byBasicAuthSecurityFilter
which can look up a user based on a username and password.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.security.Principal
authenticate(java.lang.String username, java.lang.String password)
Looks up a user.
-
-
-
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 castSecurityContext.getUserPrincipal()
to your custom class.- Parameters:
username
- The usernamepassword
- The password- Returns:
- The user, or
null
if the credentials are invalid.
-
-