Created
February 10, 2015 03:48
-
-
Save javaeeeee/248cfaca3b4a1eb5688c to your computer and use it in GitHub Desktop.
Dropwizard Authenticator Subclass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GreetingAuthenticator | |
| implements Authenticator<BasicCredentials, User> { | |
| @Override | |
| public Optional<User> authenticate(BasicCredentials credentials) | |
| throws AuthenticationException { | |
| if ("crimson".equals(credentials.getPassword())) { | |
| return Optional.of(new User()); | |
| } else { | |
| return Optional.absent(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment