Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created February 10, 2015 03:59
Show Gist options
  • Select an option

  • Save javaeeeee/0598c0212d046dd1177f to your computer and use it in GitHub Desktop.

Select an option

Save javaeeeee/0598c0212d046dd1177f to your computer and use it in GitHub Desktop.
Register Dropwizard Authenticator
public void run(final DWGettingStartedConfiguration configuration,
final Environment environment) {
environment.jersey().register(AuthFactory.binder(
new BasicAuthFactory<>(
new GreetingAuthenticator(configuration.getLogin(),
configuration.getPassword()),
"SECURITY REALM",
User.class)));
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment