Package org.picketlink.idm.credential

Examples of org.picketlink.idm.credential.Password


     *          on login failure.
     */
    public boolean login(User user, String password) {

        credentials.setUserId(user.getLoginName());
        credentials.setCredential(new Password(password));

        if (identity.login() != Identity.AuthenticationResult.SUCCESS) {
            throw new AeroGearSecurityException(HttpStatus.AUTHENTICATION_FAILED);
        }

View Full Code Here


        identityManager.add( admin );
        identityManager.add( director );
        identityManager.add( user );
        identityManager.add( guest );

        identityManager.updateCredential( admin, new Password( "admin" ) );
        identityManager.updateCredential( director, new Password( "director" ) );
        identityManager.updateCredential( user, new Password( "user" ) );
        identityManager.updateCredential( guest, new Password( "guest" ) );

        final Role roleAdmin = new Role( "admin" );
        final Role roleAnalyst = new Role( "analyst" );

        identityManager.add( roleAdmin );
View Full Code Here

     * @param user
     */
    @Override
    public void create(User user, String password) {
        identityManager.add(user);
        identityManager.updateCredential(user, new Password(password));
    }
View Full Code Here

  private DefaultLoginCredentials credentials;

  @Override
  public User login(String username, String password) {
    credentials.setUserId(username);
    credentials.setCredential(new Password(password));

    if (identity.login() != Identity.AuthenticationResult.SUCCESS) {
      throw new AuthenticationException();
    }
View Full Code Here

    public void reset(User user, String currentPassword, String newPassword) {

        credentialMatcher.validate(user, currentPassword);

        if (credentialMatcher.hasExpired() || credentialMatcher.isValid()) {
            this.identityManager.updateCredential(user, new Password(newPassword));
        } else {
            throw new AeroGearSecurityException(HttpStatus.PASSWORD_RESET_FAILED);
        }
    }
View Full Code Here

     * @param user
     */
    @Override
    public void create(User user, String password) {
        identityManager.add(user);
        identityManager.updateCredential(user, new Password(password));
    }
View Full Code Here

     *          on login failure.
     */
    public boolean login(User user, String password) {

        credentials.setUserId(user.getLoginName());
        credentials.setCredential(new Password(password));

        credentialMatcher.validate(user, password);

        if (credentialMatcher.hasExpired()) {
            throw new AeroGearSecurityException(HttpStatus.CREDENTIAL_HAS_EXPIRED);
View Full Code Here

     * @param user
     * @param password
     * @return builder implementation
     */
    public void validate(User user, String password) {
        Credentials credential = new UsernamePasswordCredentials(user.getLoginName(), new Password(password));
        identityManager.validateCredentials(credential);
        this.credential = credential;
    }
View Full Code Here

        identityManager.add(picketLinkUser);
        /*
         * Disclaimer: PlainTextPassword will encode passwords in SHA-512 with SecureRandom-1024 salt
         * See http://lists.jboss.org/pipermail/security-dev/2013-January/000650.html for more information
         */
        identityManager.updateCredential(picketLinkUser, new Password(aeroGearUser.getPassword()));
    }
View Full Code Here

    public void reset(User user, String currentPassword, String newPassword) {

        credentialMatcher.validate(user, currentPassword);

        if (credentialMatcher.hasExpired() || credentialMatcher.isValid()) {
            this.identityManager.updateCredential(user, new Password(newPassword));
        } else {
            throw new AeroGearSecurityException(HttpStatus.PASSWORD_RESET_FAILED);
        }
    }
View Full Code Here

TOP

Related Classes of org.picketlink.idm.credential.Password

Copyright © 2018 www.massapicom. 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.