Example usage for org.apache.shiro.authc CredentialsException CredentialsException

List of usage examples for org.apache.shiro.authc CredentialsException CredentialsException

Introduction

In this page you can find the example usage for org.apache.shiro.authc CredentialsException CredentialsException.

Prototype

public CredentialsException() 

Source Link

Document

Creates a new CredentialsException.

Usage

From source file:com.app.util.UserUtil.java

License:Open Source License

private static void _validateCredentials(String emailAddress, String encryptedPassword, String password,
        String salt) throws CredentialsException {

    boolean credentialsMatch = _hashedCredentialsMatcher.doCredentialsMatch(
            new UsernamePasswordToken(emailAddress, password),
            new UserSaltedAuthenticationInfo(emailAddress, encryptedPassword, salt));

    if (ValidatorUtil.isNull(encryptedPassword) || ValidatorUtil.isNull(password) || !credentialsMatch) {

        throw new CredentialsException();
    }/*from   ww w  .j a v a 2  s. c om*/
}