Examples of UserEntity


Examples of org.glassfish.jersey.examples.bookmark_em.entity.UserEntity

        }

        final boolean newRecord = (null == userEntity); // insert or update ?

        if (newRecord) { // new user record to be inserted
            userEntity = new UserEntity();
            userEntity.setUserid(userid);
        }
        userEntity.setUsername(jsonEntity.getString("username"));
        userEntity.setEmail(jsonEntity.getString("email"));
        userEntity.setPassword(jsonEntity.getString("password"));
View Full Code Here

Examples of org.keycloak.models.jpa.entities.UserEntity

    public UserModel addUser(RealmModel realm, String id, String username, boolean addDefaultRoles) {
        if (id == null) {
            id = KeycloakModelUtils.generateId();
        }

        UserEntity entity = new UserEntity();
        entity.setId(id);
        entity.setUsername(username);
        entity.setRealmId(realm.getId());
        em.persist(entity);
        em.flush();
        UserModel userModel = new UserAdapter(realm, em, entity);

        if (addDefaultRoles) {
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

  @Override
  public Object runCommand() throws RepositoryException, IOException {
    UserDatabase userRepository = getContext().getUserRepository();

    UserEntity me = getContext().loginDirect();
    ProjectEntity project = userRepository.findProjectByKey(projectKey.getKey());
    if (project == null) {
      throw new CliException("Project not found: " + projectKey.getKey());
    }
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

    UserDatabase userRepository = getContext().getUserRepository();

    // if (username == null) {
    // return userRepository.listAllProjectNames(null);
    // } else {
    UserEntity user = (UserEntity) userRepository.findUser(username.getKey());
    if (user == null) {
      throw new IllegalArgumentException("User not found");
    }
    return userRepository.listProjectsByUserId(user.id);
    // }
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

  @Override
  public Object runCommand() throws RepositoryException {
    UserDatabase userRepository = getContext().getUserRepository();

    // We need to login to unlock the user key so we can encrypt the project key!
    UserEntity me = getContext().loginDirect();

    if (projectKey.contains("@@")) {
      throw new CliException("Project names with @@ are reserved for system uses");
    }
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

    String password = options.getPassword();
    if (username == null || password == null) {
      throw new IllegalArgumentException("Must specify username & password");
    }

    UserEntity user = (UserEntity) getUserRepository().authenticateWithPassword(username, password);
    if (user == null) {
      throw new SecurityException("Credentials were not valid");
    }
    return user;
  }
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

    } catch (AuthenticatorException e) {
      log.warn("Error while checking system token", e);
      throwInternalError();
    }

    UserEntity userEntity = null;
    try {
      boolean unlock = false;
      userEntity = userAuthenticator.findUserFromKeychain(chain, unlock);
    } catch (AuthenticatorException e) {
      log.warn("Error while fetching user", e);
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

    TokenInfo checkTokenInfo = tokenService.decodeToken(checkToken);
    if (checkTokenInfo == null || checkTokenInfo.hasExpired()) {
      throw404NotFound();
    }

    UserEntity userEntity = null;
    try {
      userEntity = userAuthenticator.getUserFromToken(checkTokenInfo.userId, checkTokenInfo.tokenSecret);
    } catch (AuthenticatorException e) {
      log.warn("Error while fetching user", e);
      throwInternalError();
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

    RegistrationResponse response = new RegistrationResponse();

    String username = request.username;
    String password = request.password;

    UserEntity userEntity;
    try {
      OpsUser user = registrationService.registerUser(username, password);
      userEntity = (UserEntity) user;
    } catch (CustomerFacingException e) {
      response.errorMessage = e.getMessage();
View Full Code Here

Examples of org.platformlayer.auth.UserEntity

  public AuthenticateResponse authenticate(HttpServletRequest httpRequest, AuthenticateRequest request) {
    AuthenticateResponse response = new AuthenticateResponse();

    String username = null;

    UserEntity user = null;

    if (request.auth.passwordCredentials != null) {
      username = request.auth.passwordCredentials.username;
      String password = request.auth.passwordCredentials.password;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.