org.figure8.join.services.security
Class SimplePasswordEncoder

java.lang.Object
  extended by org.figure8.join.services.security.SimplePasswordEncoder
All Implemented Interfaces:
PasswordEncoder

public class SimplePasswordEncoder
extends java.lang.Object
implements PasswordEncoder

This is a simple implementation of PasswordEncoder that does not apply any encoding. Don't use it in production environment, this is only for test purposes !

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux

Constructor Summary
SimplePasswordEncoder()
           
 
Method Summary
 java.lang.String encodePassword(java.lang.String userId, java.lang.String clearPassword, java.lang.Object[] arguments)
          Do no encoding.
 boolean validatePassword(java.lang.String userId, java.lang.String inputPassword, java.lang.String expectedPassword)
          Do basic validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePasswordEncoder

public SimplePasswordEncoder()
Method Detail

encodePassword

public java.lang.String encodePassword(java.lang.String userId,
                                       java.lang.String clearPassword,
                                       java.lang.Object[] arguments)
Do no encoding. Just return the clearPassword.

Specified by:
encodePassword in interface PasswordEncoder
Parameters:
userId - The user identifier
clearPassword - The non encoded password of the user
arguments - Arguments for encoding process
Returns:
the encoded password.

validatePassword

public boolean validatePassword(java.lang.String userId,
                                java.lang.String inputPassword,
                                java.lang.String expectedPassword)
Do basic validation. Just ensure that inputPassword and expectedPassword are not null and equals to each other.

Specified by:
validatePassword in interface PasswordEncoder
Parameters:
userId - The user identifier
inputPassword - The password provided by the user
expectedPassword - The real user's pasword
Returns:
true if the inputPassword is valid, false otherwise.


Copyright © 2005-2008 Join. All Rights Reserved.