Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to redefine the Password Plugins in the module SecureSocial 2 with play framework 2
    text
    copied!<p>I'm trying to redefine the password validator and the password hasher of the securesocial plugin for play 2 in java because my authentification process won't work.. (actually everything seems to be right be I can't manage to log myself with the hash password store in my database)</p> <p>I already exend the passwordValidator as the documentation explain it (http://securesocial.ws/guide/password-plugins.html)</p> <p>public class BCryptPasswordHasher extends BasePasswordHasher{</p> <pre><code>public PasswordInfo doHash(String plainPassword){ PasswordInfo pI = new PasswordInfo(); pI.password = BCrypt.hashpw(plainPassword, BCrypt.gensalt()); return pI; } public boolean doMatch(PasswordInfo passwordInfo, String suppliedPassword){ return BCrypt.checkpw(suppliedPassword, passwordInfo.password); } </code></pre> <p>}</p> <p>I get this error:</p> <p>tools.BCryptPasswordHasher is not abstract and does not override abstract method doMatch(securesocial.core.java.PasswordInfo,java.lang.String) in securesocial.core.java.BasePasswordHasher</p> <p>Do you know how I can manage to do this? </p> <p>Thank you in advance for your help</p> <p>PS: BasePasswordHasher</p> <p>public abstract class BasePasswordHasher implements PasswordHasher { protected Application application;</p> <pre><code>public BasePasswordHasher(Application application) { this.application = application; } @Override public securesocial.core.PasswordInfo hash(String plainPassword) { return doHash(plainPassword).toScala(); } @Override public boolean matches(securesocial.core.PasswordInfo passwordInfo, String suppliedPassword) { return doMatch(PasswordInfo.fromScala(passwordInfo), suppliedPassword); } /** * Hashes a password * * @param plainPassword the password to hash * @return a PasswordInfo containting the hashed password and optional salt */ abstract PasswordInfo doHash(String plainPassword); /** * Checks whether a supplied password matches the hashed one * * @param passwordInfo the password retrieved from the backing store (by means of UserService) * @param suppliedPassword the password supplied by the user trying to log in * @return true if the password matches, false otherwise. */ abstract boolean doMatch(PasswordInfo passwordInfo, String suppliedPassword); </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload