All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.castled.CastledAuthenticator Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.castled;

import com.google.inject.Inject;
import io.castled.models.users.User;
import io.castled.services.UsersService;
import io.dropwizard.auth.Authenticator;

import java.util.Optional;

public class CastledAuthenticator implements Authenticator {

    private final UsersService usersService;

    @Inject
    public CastledAuthenticator(UsersService usersService) {
        this.usersService = usersService;
    }

    @Override
    public Optional authenticate(String dummy) {
        return Optional.ofNullable(usersService.getUser());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy