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;
}
Aggregations