org.apache.shiro.authc.credential
Class PasswordMatcher

java.lang.Object
  extended by org.apache.shiro.authc.credential.PasswordMatcher
All Implemented Interfaces:
CredentialsMatcher

public class PasswordMatcher
extends Object
implements CredentialsMatcher

A CredentialsMatcher that employs best-practices comparisons for hashed text passwords.

This implementation delegates to an internal PasswordService to perform the actual password comparison. This class is essentially a bridge between the generic CredentialsMatcher interface and the more specific PasswordService component.

Since:
1.2

Constructor Summary
PasswordMatcher()
           
 
Method Summary
 boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
          Returns true if the provided token credentials match the stored account credentials, false otherwise.
 PasswordService getPasswordService()
           
protected  Object getStoredPassword(AuthenticationInfo storedAccountInfo)
           
protected  Object getSubmittedPassword(AuthenticationToken token)
           
 void setPasswordService(PasswordService passwordService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordMatcher

public PasswordMatcher()
Method Detail

doCredentialsMatch

public boolean doCredentialsMatch(AuthenticationToken token,
                                  AuthenticationInfo info)
Description copied from interface: CredentialsMatcher
Returns true if the provided token credentials match the stored account credentials, false otherwise.

Specified by:
doCredentialsMatch in interface CredentialsMatcher
Parameters:
token - the AuthenticationToken submitted during the authentication attempt
info - the AuthenticationInfo stored in the system.
Returns:
true if the provided token credentials match the stored account credentials, false otherwise.

getSubmittedPassword

protected Object getSubmittedPassword(AuthenticationToken token)

getStoredPassword

protected Object getStoredPassword(AuthenticationInfo storedAccountInfo)

getPasswordService

public PasswordService getPasswordService()

setPasswordService

public void setPasswordService(PasswordService passwordService)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.