@SupportsCredentials(credentialClass={UsernamePasswordCredentials.class,Password.class}, credentialStorage=EncodedPasswordStorage.class) public class PasswordCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password> extends AbstractCredentialHandler<S,V,U>
This particular implementation supports the validation of UsernamePasswordCredentials
, and updating
Password
credentials.
How passwords are encoded can be changed by specifying a
configuration option using the PASSWORD_ENCODER
. By default a SHA-512 encoding is performed.
Password are always salted before encoding.
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM_RANDOM_NUMBER
The algorithm to be used to salt passwords.
|
static String |
KEY_LENGTH_RANDOM_NUMBER
Key length when generating a seed for random numbers.
|
static String |
PASSWORD_ENCODER
Stores a stateless instance of
PasswordEncoder that should be used to encode passwords. |
static String |
RENEW_RANDOM_NUMBER_GENERATOR_INTERVAL
Time interval to be used to get a fresh
SecureRandom instance. |
static String |
SECURE_RANDOM_PROVIDER
An user-defined
SecureRandomProvider instance. |
Constructor and Description |
---|
PasswordCredentialHandler() |
Modifier and Type | Method and Description |
---|---|
CredentialStorage |
createCredentialStorage(IdentityContext context,
Account account,
U password,
S store,
Date effectiveDate,
Date expiryDate) |
protected String |
generateSalt()
Generates a random string to be used as a salt for passwords.
|
protected Account |
getAccount(IdentityContext context,
V credentials) |
protected CredentialStorage |
getCredentialStorage(IdentityContext context,
Account account,
V credentials,
S store) |
protected org.picketlink.common.random.SecureRandomProvider |
getSecureRandomProvider() |
void |
setup(S store) |
protected boolean |
validateCredential(IdentityContext context,
CredentialStorage storage,
V credentials,
S store) |
getAccount, getAccountById, getDefaultLoginNameProperty, getIdentityManager, isDebugEnabled, update, validate
public static final String PASSWORD_ENCODER
Stores a stateless instance of PasswordEncoder
that should be used to encode passwords.
public static final String SECURE_RANDOM_PROVIDER
An user-defined SecureRandomProvider
instance.
public static final String RENEW_RANDOM_NUMBER_GENERATOR_INTERVAL
Time interval to be used to get a fresh SecureRandom
instance.
public static final String ALGORITHM_RANDOM_NUMBER
The algorithm to be used to salt passwords.
public static final String KEY_LENGTH_RANDOM_NUMBER
Key length when generating a seed for random numbers.
public void setup(S store)
setup
in interface CredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
setup
in class AbstractCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
protected Account getAccount(IdentityContext context, V credentials)
getAccount
in class AbstractCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
protected CredentialStorage getCredentialStorage(IdentityContext context, Account account, V credentials, S store)
getCredentialStorage
in class AbstractCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
protected boolean validateCredential(IdentityContext context, CredentialStorage storage, V credentials, S store)
validateCredential
in class AbstractCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
public CredentialStorage createCredentialStorage(IdentityContext context, Account account, U password, S store, Date effectiveDate, Date expiryDate)
createCredentialStorage
in class AbstractCredentialHandler<S extends CredentialStore<?>,V extends UsernamePasswordCredentials,U extends Password>
protected org.picketlink.common.random.SecureRandomProvider getSecureRandomProvider()
protected String generateSalt()
Generates a random string to be used as a salt for passwords.
Copyright © 2015. All rights reserved.