public interface BasicPrincipalAuthenticator
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<? extends RestxPrincipal> |
authenticate(String name,
String passwordHash,
com.google.common.collect.ImmutableMap<String,?> principalData)
Authenticates a principal by name and passwordHash.
|
com.google.common.base.Optional<? extends RestxPrincipal> |
findByName(String name)
Finds a principal by name.
|
com.google.common.base.Optional<? extends RestxPrincipal> findByName(String name)
name - the principal namecom.google.common.base.Optional<? extends RestxPrincipal> authenticate(String name, String passwordHash, com.google.common.collect.ImmutableMap<String,?> principalData)
Note that usually the passwordHash has been hashed on the client with a weak hashing function like md5, therefore it is strongly recommended to hash it again with salt and a strong hashing function like bcrypt.
Read http://codingkilledthecat.wordpress.com/2012/09/04/some-best-practices-for-web-app-authentication/ for some best practices about password authentication.
this method may choose to throw WebException when authentication fails to give additional details, or simply return an absent principal.
name - the principal namepasswordHash - the provided password hash (default is md5)principalData - any additional data provided during authenticationCopyright © 2014. All Rights Reserved.