Package io.muserver.rest
Interface UserPassAuthenticator
-
public interface UserPassAuthenticatorAn authenticator used byBasicAuthSecurityFilterwhich 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.Principalauthenticate(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@Contextannotation on a REST method) and castSecurityContext.getUserPrincipal()to your custom class.- Parameters:
username- The usernamepassword- The password- Returns:
- The user, or
nullif the credentials are invalid.
-
-