Example usage for org.apache.shiro.authc.credential PasswordMatcher getPasswordService

List of usage examples for org.apache.shiro.authc.credential PasswordMatcher getPasswordService

Introduction

In this page you can find the example usage for org.apache.shiro.authc.credential PasswordMatcher getPasswordService.

Prototype

public PasswordService getPasswordService() 

Source Link

Usage

From source file:waffle.shiro.AbstractWaffleRealm.java

License:Open Source License

/**
 * Gets the hash service.//  ww  w  .j  av a  2s .  c  o m
 *
 * @return the hash service
 */
private HashingPasswordService getHashService() {
    final CredentialsMatcher matcher = this.getCredentialsMatcher();
    if (matcher instanceof PasswordMatcher) {
        final PasswordMatcher passwordMatcher = (PasswordMatcher) matcher;
        final PasswordService passwordService = passwordMatcher.getPasswordService();
        if (passwordService instanceof HashingPasswordService) {
            return (HashingPasswordService) passwordService;
        }
    }
    return null;
}