Commit 9056ef2d authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

rename authenticator

parent b70e6b96
......@@ -5,7 +5,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.ClassPath;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.telephoners.krakyournet.ctf.auth.ExampleAuthenticator;
import com.telephoners.krakyournet.ctf.auth.UserAuthenticator;
import com.telephoners.krakyournet.ctf.beans.User;
import com.telephoners.krakyournet.ctf.commands.PurgeDatabaseCommand;
import com.telephoners.krakyournet.ctf.commands.RegisterTasksCommand;
......@@ -56,7 +56,7 @@ public class CTFApplication extends Application<ApplicationConfiguration>
{
environment.jersey().register(new AuthDynamicFeature(
new BasicCredentialAuthFilter.Builder<User>()
.setAuthenticator(injector.getInstance(ExampleAuthenticator.class))
.setAuthenticator(injector.getInstance(UserAuthenticator.class))
.buildAuthFilter()));
environment.jersey().register(RolesAllowedDynamicFeature.class);
environment.jersey().register(new AuthValueFactoryProvider.Binder<>(User.class));
......
......@@ -8,13 +8,12 @@ import io.dropwizard.auth.AuthenticationException;
import io.dropwizard.auth.Authenticator;
import io.dropwizard.auth.basic.BasicCredentials;
public class ExampleAuthenticator implements Authenticator<BasicCredentials, User>
public class UserAuthenticator implements Authenticator<BasicCredentials, User>
{
private UsersRepository usersRepository;
@Inject
public ExampleAuthenticator(UsersRepository usersRepository)
public UserAuthenticator(UsersRepository usersRepository)
{
this.usersRepository = usersRepository;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment