Search in sources :

Example 1 with BasicAuthManager

use of org.neo4j.server.security.auth.BasicAuthManager in project neo4j by neo4j.

the class BasicAuthenticationTest method setup.

@Before
public void setup() throws Throwable {
    UserRepository userRepository = new InMemoryUserRepository();
    PasswordPolicy policy = mock(PasswordPolicy.class);
    BasicAuthManager manager = new BasicAuthManager(userRepository, policy, Clocks.systemClock(), userRepository);
    authentication = new BasicAuthentication(manager, manager);
    manager.newUser("bob", "secret", true);
    manager.newUser("mike", "secret2", false);
}
Also used : UserRepository(org.neo4j.server.security.auth.UserRepository) InMemoryUserRepository(org.neo4j.server.security.auth.InMemoryUserRepository) BasicAuthManager(org.neo4j.server.security.auth.BasicAuthManager) PasswordPolicy(org.neo4j.kernel.api.security.PasswordPolicy) InMemoryUserRepository(org.neo4j.server.security.auth.InMemoryUserRepository) Before(org.junit.Before)

Example 2 with BasicAuthManager

use of org.neo4j.server.security.auth.BasicAuthManager in project neo4j by neo4j.

the class UserServiceTest method setupAuthManagerAndSubject.

protected void setupAuthManagerAndSubject() {
    BasicAuthManager basicAuthManager = new BasicAuthManager(userRepository, passwordPolicy, mock(AuthenticationStrategy.class), new InMemoryUserRepository());
    userManagerSupplier = basicAuthManager;
    neo4jContext = new BasicSecurityContext(basicAuthManager, NEO4J_USER, AuthenticationResult.SUCCESS);
}
Also used : BasicAuthManager(org.neo4j.server.security.auth.BasicAuthManager) AuthenticationStrategy(org.neo4j.server.security.auth.AuthenticationStrategy) BasicSecurityContext(org.neo4j.server.security.auth.BasicSecurityContext) InMemoryUserRepository(org.neo4j.server.security.auth.InMemoryUserRepository)

Aggregations

BasicAuthManager (org.neo4j.server.security.auth.BasicAuthManager)2 InMemoryUserRepository (org.neo4j.server.security.auth.InMemoryUserRepository)2 Before (org.junit.Before)1 PasswordPolicy (org.neo4j.kernel.api.security.PasswordPolicy)1 AuthenticationStrategy (org.neo4j.server.security.auth.AuthenticationStrategy)1 BasicSecurityContext (org.neo4j.server.security.auth.BasicSecurityContext)1 UserRepository (org.neo4j.server.security.auth.UserRepository)1