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