Search in sources :

Example 1 with ProtoUser

use of com.bakdata.conquery.apiv1.auth.ProtoUser in project conquery by bakdata.

the class UserAuthenticationManagementProcessor method tryRegister.

public boolean tryRegister(ProtoUser pUser) {
    final UserId id = pUser.createId();
    User user = storage.getUser(id);
    if (user == null) {
        log.warn("Unable to add new user {}. Probably already existed.", pUser);
        return false;
    }
    log.trace("Added the user {} to the authorization storage", id);
    if (AuthorizationHelper.registerForAuthentication(realm, user, pUser.getCredentials(), false)) {
        log.trace("Added the user {} to the realm {}", id, realm.getName());
        return true;
    }
    log.trace("Failed to add added the user {} to the realm {}", id, realm.getName());
    return false;
}
Also used : ProtoUser(com.bakdata.conquery.apiv1.auth.ProtoUser) User(com.bakdata.conquery.models.auth.entities.User) UserId(com.bakdata.conquery.models.identifiable.ids.specific.UserId)

Example 2 with ProtoUser

use of com.bakdata.conquery.apiv1.auth.ProtoUser in project conquery by bakdata.

the class UserAuthenticationManagementProcessor method updateUser.

public boolean updateUser(ProtoUser pUser) {
    final User user = pUser.createOrOverwriteUser(storage);
    AuthorizationHelper.registerForAuthentication(realm, user, pUser.getCredentials(), false);
    return true;
}
Also used : ProtoUser(com.bakdata.conquery.apiv1.auth.ProtoUser) User(com.bakdata.conquery.models.auth.entities.User)

Aggregations

ProtoUser (com.bakdata.conquery.apiv1.auth.ProtoUser)2 User (com.bakdata.conquery.models.auth.entities.User)2 UserId (com.bakdata.conquery.models.identifiable.ids.specific.UserId)1