Examples of QxAccount


Examples of tomekkup.helenos.types.qx.QxAccount

    private void ensureDefaultCreds() {
        try {
            loadUserByUsername("admin");
        } catch (UsernameNotFoundException e) {
            String encodedPasswd = encodePasswd("admin", "admin");
            QxAccount user = new QxAccount("admin", encodedPasswd, new SimpleGrantedAuthority(ROLE_ADMIN), true);
            user.addAuthority(new SimpleGrantedAuthority(ROLE_USER));

            store(user);
        }
    }
View Full Code Here

Examples of tomekkup.helenos.types.qx.QxAccount

            store(user);
        }
    }

    private String encodePasswd(String username, String passwd) {
        return passwordEncoder.encodePassword(passwd, saltSource.getSalt(new QxAccount(username)));
    }
View Full Code Here

Examples of tomekkup.helenos.types.qx.QxAccount

    private String encodePasswd(String username, String passwd) {
        return passwordEncoder.encodePassword(passwd, saltSource.getSalt(new QxAccount(username)));
    }

    private void encodePasswd(QxAccount user) {
        user.setPassword(passwordEncoder.encodePassword(user.getPassword(), saltSource.getSalt(new QxAccount(user.getUsername()))));
    }
View Full Code Here

Examples of tomekkup.helenos.types.qx.QxAccount

            throw new IllegalStateException("both passwords must equal");
        }
        if (!StringUtils.hasText(pcr.getPassword2())) {
            throw new IllegalStateException("password can not be empty");
        }
        QxAccount account = (QxAccount) loadUserByUsername(pcr.getUsername());
        account.setPassword(encodePasswd(pcr.getUsername(), pcr.getPassword1()));
        this.store(account);
    }
View Full Code Here

Examples of tomekkup.helenos.types.qx.QxAccount

    private static final class UserMapper implements RowMapper<QxAccount> {

        @Override
        public QxAccount mapRow(ResultSet rs, int rowNum) throws SQLException {
            QxAccount user = new QxAccount();
            user.setUsername(rs.getString("USERNAME"));
            user.setPassword(rs.getString("PASSWORD"));
            user.setEnabled(rs.getBoolean("ENABLED"));

            String[] tempAuths = StringUtils.commaDelimitedListToStringArray(rs.getString("AUTHORITIES"));
            Collection<SimpleGrantedAuthority> authorities = new HashSet<SimpleGrantedAuthority>();
            for (String ta : tempAuths) {
                authorities.add(new SimpleGrantedAuthority(ta));
            }
            user.setAuthorities(authorities);
            return user;
        }
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.