Examples of PasswordDigest


Examples of org.waveprotocol.box.server.authentication.PasswordDigest

      // Register the user with an empty password.
      password = "";
    }

    if (!RegistrationUtil.createAccountIfMissing(accountStore, id,
          new PasswordDigest(password.toCharArray()), welcomeBot)) {
      return "An unexpected error occured while trying to create the account";
    }

    return null;
  }
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

  @Override
  public AccountData getAccount(ParticipantId id) {
    AccountData account = accounts.get(id);

    if (account == null && !id.getAddress().startsWith("xxx")) {
      account = new HumanAccountDataImpl(id, new PasswordDigest("".toCharArray()));
      accounts.put(id, account);
    }

    return account;
  }
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

      // Register the user with an empty password.
      password = "";
    }

    HumanAccountDataImpl account =
      new HumanAccountDataImpl(id, new PasswordDigest(password.toCharArray()));
    try {
      accountStore.putAccount(account);
    } catch (PersistenceException e) {
      LOG.severe("Failed to create new account for " + id, e);
      return "An unexpected error occured while trying to create the account";
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

  @Override
  public AccountData getAccount(ParticipantId id) {
    AccountData account = accounts.get(id);

    if (account == null && !id.getAddress().startsWith("xxx")) {
      account = new HumanAccountDataImpl(id, new PasswordDigest("".toCharArray()));
      accounts.put(id, account);
    }

    return account;
  }
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

  // ****** HumanAccountData serialization

  private DBObject humanToObject(HumanAccountData account) {
    DBObject object = new BasicDBObject();

    PasswordDigest digest = account.getPasswordDigest();
    if (digest != null) {
      DBObject digestObj = new BasicDBObject();
      digestObj.put(PASSWORD_SALT_FIELD, digest.getSalt());
      digestObj.put(PASSWORD_DIGEST_FIELD, digest.getDigest());

      object.put(HUMAN_PASSWORD_FIELD, digestObj);
    }

    return object;
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

    return object;
  }

  private HumanAccountData objectToHuman(ParticipantId id, DBObject object) {
    PasswordDigest passwordDigest = null;

    DBObject digestObj = (DBObject) object.get(HUMAN_PASSWORD_FIELD);
    if (digestObj != null) {
      byte[] salt = (byte[]) digestObj.get(PASSWORD_SALT_FIELD);
      byte[] digest = (byte[]) digestObj.get(PASSWORD_DIGEST_FIELD);
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

   * @throws PersistenceException if the persistence layer fails.
   * @throws IllegalArgumentException if the user doesn't exist.
   */
  public static void changeUserPassword(String newPassword, ParticipantId participantId,
      AccountStore accountStore) throws PersistenceException, IllegalArgumentException {
    PasswordDigest newPasswordDigest = new PasswordDigest(newPassword.toCharArray());
    HumanAccountDataImpl account = new HumanAccountDataImpl(participantId, newPasswordDigest);
    if (accountStore.getAccount(participantId) != null) {
      accountStore.removeAccount(participantId);
      accountStore.putAccount(account);
    } else {
View Full Code Here

Examples of org.waveprotocol.box.server.authentication.PasswordDigest

    throws PersistenceException, IllegalArgumentException {
    if (accountStore.getAccount(participantId) != null) {
      throw new IllegalArgumentException(String.format("User %s already exists on this domain.", participantId.getAddress()));
    }

    HumanAccountDataImpl account = new HumanAccountDataImpl(participantId, new PasswordDigest(password.toCharArray()));
    accountStore.putAccount(account);
  }
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.