Package org.picketlink.idm.model.sample

Examples of org.picketlink.idm.model.sample.User


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

        User picketLinkUser = SampleModel.getUser(identityManager, username);

        for (Role role : list) {
            SampleModel.grantRole(partitionManager.createRelationshipManager(), picketLinkUser, role);
        }

View Full Code Here


        return grantConfiguration.roles(roles);
    }

    @Override
    public User findByUsername(String username) throws RuntimeException {
        User user = SampleModel.getUser(identityManager, 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.getAccount();

        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

        wasCalled = true;
        if(shouldFailAuth) {
            setStatus(AuthenticationStatus.FAILURE);
        } else {
            setStatus(AuthenticationStatus.SUCCESS);
            setAccount(new User());
        }
    }
View Full Code Here

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

        User picketLinkUser = SampleModel.getUser(identityManager, username);

        for (Role role : list) {
            SampleModel.grantRole(partitionManager.createRelationshipManager(), picketLinkUser, role);
        }

View Full Code Here

     * @param username
     * @return User
     */
    @Override
    public User findByUsername(String username) throws RuntimeException {
        User user = SampleModel.getUser(identityManager, 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.getAccount();

        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

TOP

Related Classes of org.picketlink.idm.model.sample.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.