Package org.picketlink.idm.model

Examples of org.picketlink.idm.model.User


        return grantConfiguration.revoke(roles);
    }

    @Override
    public User findByUsername(String username) throws RuntimeException {
        User user = identityManager.getUser(username);
        if (user == null) {
            throw new AeroGearSecurityException(HttpStatus.CREDENTIAL_NOT_FOUND);
        }
        return user;
    }
View Full Code Here


     */
    @Produces
    @Secret
    public String getSecret() {

        User user = (User) identity.getAgent();

        Attribute<String> secret = user.getAttribute(IDM_SECRET_ATTRIBUTE);

        if (secret == null) {
            secret = new Attribute<String>(IDM_SECRET_ATTRIBUTE, Base32.random());
            user.setAttribute(secret);
            this.identityManager.update(user);
        }
        return secret.getValue();
    }
View Full Code Here

        return grantConfiguration.roles(roles);
    }

    @Override
    public AeroGearUser get(String id) throws RuntimeException {
        User user = identityManager.getUser(id);
        if (user == null) {
            throw new RuntimeException("User do not exist");
        }
        return Converter.convertToAerogearUser(identityManager.getUser(id));
    }
View Full Code Here

     *
     * @param aeroGearUser
     */
    @Override
    public void create(AeroGearUser aeroGearUser) {
        User picketLinkUser = new SimpleUser(aeroGearUser.getUsername());
        picketLinkUser.setEmail(aeroGearUser.getEmail());
        picketLinkUser.setFirstName(aeroGearUser.getFirstName());
        picketLinkUser.setLastName(aeroGearUser.getLastName());
        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
         */
 
View Full Code Here

        return grantConfiguration.roles(roles);
    }

    @Override
    public User findByUsername(String username) throws RuntimeException {
        User user = identityManager.getUser(username);
        if (user == null) {
            throw new RuntimeException("User do not exist");
        }
        return user;
    }
View Full Code Here

     */
    @Produces
    @Secret
    public String getSecret() {

        User user = (User) identity.getAgent();

        Attribute<String> secret = user.getAttribute(IDM_SECRET_ATTRIBUTE);

        if (secret == null) {
            secret = new Attribute<String>(IDM_SECRET_ATTRIBUTE, Base32.random());
            user.setAttribute(secret);
            this.identityManager.update(user);
        }
        return secret.getValue();
    }
View Full Code Here

     */
    //TODO this entire initialization code will be removed
    @PostConstruct
    public void create() {

        User user = new SimpleUser("john");

        user.setEmail("john@doe.com");
        user.setFirstName("John");
        user.setLastName("Doe");

        /*
         * Note: Password will be encoded in SHA-512 with SecureRandom-1024 salt
         * See http://lists.jboss.org/pipermail/security-dev/2013-January/000650.html for more information
         */
 
View Full Code Here

     */
    @Produces
    @Secret
    public String getSecret() {

        User user = identity.getUser();

        Attribute<String> secret = user.getAttribute(IDM_SECRET_ATTRIBUTE);

        if (secret == null) {
            secret = new Attribute<String>(IDM_SECRET_ATTRIBUTE, Base32.random());
            user.setAttribute(secret);
            this.identityManager.update(user);
        }
        return secret.getValue();
    }
View Full Code Here

    }

    @Produces
    @Token
    public String getToken() {
        User user = identity.getUser();

        Attribute<String> token = user.getAttribute(TOKEN_ATTRIBUTE);

        if (token == null) {
            token = new Attribute<String>(TOKEN_ATTRIBUTE, UUID.randomUUID().toString());
            user.setAttribute(token);
            this.identityManager.update(user);
        }
        return token.getValue();
    }
View Full Code Here

     * @param aeroGearUser represents a simple user's implementation to hold credentials.
     */
    @Override
    public void to(AeroGearUser aeroGearUser) {

        User picketLinkUser = identityManager.getUser(aeroGearUser.getUsername());

        for (Role role : list) {
            identityManager.grantRole(picketLinkUser, role);
        }

View Full Code Here

TOP

Related Classes of org.picketlink.idm.model.User

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.