public interface UserPassAuthenticator
BasicAuthSecurityFilter
which can look up a user based on a username and password.Modifier and Type | Method and Description |
---|---|
Principal |
authenticate(String username,
String password)
Looks up a user.
|
Principal authenticate(String username, 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.
username
- The usernamepassword
- The passwordnull
if the credentials are invalid.Copyright © 2017–2019. All rights reserved.