List of usage examples for org.apache.shiro.authc.credential HashingPasswordService hashPassword
Hash hashPassword(Object plaintext) throws IllegalArgumentException;
From source file:waffle.shiro.AbstractWaffleRealm.java
License:Open Source License
/** * Builds the authentication info./* w w w . ja v a2 s.com*/ * * @param token * the token * @param principal * the principal * @return the authentication info */ private AuthenticationInfo buildAuthenticationInfo(final UsernamePasswordToken token, final Object principal) { AuthenticationInfo authenticationInfo; final HashingPasswordService hashService = this.getHashService(); if (hashService != null) { final Hash hash = hashService.hashPassword(token.getPassword()); final ByteSource salt = hash.getSalt(); authenticationInfo = new SimpleAuthenticationInfo(principal, hash, salt, AbstractWaffleRealm.REALM_NAME); } else { final Object creds = token.getCredentials(); authenticationInfo = new SimpleAuthenticationInfo(principal, creds, AbstractWaffleRealm.REALM_NAME); } return authenticationInfo; }