Search in sources :

Example 1 with JpaUser

use of org.apache.archiva.redback.users.jpa.model.JpaUser in project archiva by apache.

the class SecuritySystemStub method authenticate.

@Override
public SecuritySession authenticate(AuthenticationDataSource source) throws AuthenticationException, UserNotFoundException, AccountLockedException {
    AuthenticationResult result = null;
    SecuritySession session = null;
    if (users.get(source.getUsername()) != null) {
        result = new AuthenticationResult(true, source.getUsername(), null);
        User user = new JpaUser();
        user.setUsername(source.getUsername());
        user.setPassword(users.get(source.getUsername()));
        session = new DefaultSecuritySession(result, user);
    } else {
        result = new AuthenticationResult(false, source.getUsername(), null);
        session = new DefaultSecuritySession(result);
    }
    return session;
}
Also used : User(org.apache.archiva.redback.users.User) JpaUser(org.apache.archiva.redback.users.jpa.model.JpaUser) SecuritySession(org.apache.archiva.redback.system.SecuritySession) DefaultSecuritySession(org.apache.archiva.redback.system.DefaultSecuritySession) JpaUser(org.apache.archiva.redback.users.jpa.model.JpaUser) DefaultSecuritySession(org.apache.archiva.redback.system.DefaultSecuritySession) AuthenticationResult(org.apache.archiva.redback.authentication.AuthenticationResult)

Aggregations

AuthenticationResult (org.apache.archiva.redback.authentication.AuthenticationResult)1 DefaultSecuritySession (org.apache.archiva.redback.system.DefaultSecuritySession)1 SecuritySession (org.apache.archiva.redback.system.SecuritySession)1 User (org.apache.archiva.redback.users.User)1 JpaUser (org.apache.archiva.redback.users.jpa.model.JpaUser)1