Examples of AeroGearSecurityException


Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

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

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

        return true;
    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

    }

    //TODO figure out a best place to put this method
    private void onAuthenticationFailure() {
        if (!identity.isLoggedIn())
            throw new AeroGearSecurityException(HttpStatus.AUTHENTICATION_FAILED);
    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

    private void authorize(Set<String> roles) {
        boolean hasRoles = identityManagement.hasRoles(roles);

        if (!hasRoles)
            throw new AeroGearSecurityException(HttpStatus.CREDENTIAL_NOT_AUTHORIZED);
    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

    @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

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

    }

    @Override
    public void remove(String username) {
        if (isLoggedIn(username)) {
            throw new AeroGearSecurityException(HttpStatus.ALREADY_LOGGED_IN);
        }
        identityManager.remove(identityManager.getUser(username));

    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

        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

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

        credentials.setCredential(new Password(password));

        credentialMatcher.validate(user, password);

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

        return true;
    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

    }

    //TODO figure out a best place to put this method
    private void onAuthenticationFailure() {
        if (!identity.isLoggedIn())
            throw new AeroGearSecurityException(HttpStatus.AUTHENTICATION_FAILED);
    }
View Full Code Here

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

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

Examples of org.jboss.aerogear.security.exception.AeroGearSecurityException

     * @param username
     */
    @Override
    public void remove(String username) {
        if (isLoggedIn(username)) {
            throw new AeroGearSecurityException(HttpStatus.ALREADY_LOGGED_IN);
        }
        identityManager.remove(BasicModel.getUser(identityManager, username));

    }
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.