Class UserPasswordCredentialLoader.ForIdentityLoader
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.UserPasswordCredentialLoader.ForIdentityLoader
-
- All Implemented Interfaces:
IdentityCredentialLoader
,IdentityCredentialPersister
,IdentityEvidenceVerifier
- Enclosing class:
- UserPasswordCredentialLoader
private class UserPasswordCredentialLoader.ForIdentityLoader extends Object implements IdentityCredentialPersister, IdentityEvidenceVerifier
-
-
Field Summary
Fields Modifier and Type Field Description private Attributes
attributes
private DirContext
context
private String
distinguishedName
private Encoding
hashEncoding
-
Constructor Summary
Constructors Constructor Description ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes)
ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes, Encoding hashEncoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCredentials()
Clear all supported credentials of identity.<C extends Credential>
CgetCredential(Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers)
Acquire a credential of the given type.SupportLevel
getCredentialAcquireSupport(Class<? extends Credential> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers)
Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.boolean
getCredentialPersistSupport(Class<? extends Credential> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec)
Determine whether a given credential type can be persisted by this credential persister.SupportLevel
getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String evidenceAlgorithm, Supplier<Provider[]> providers)
Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.void
persistCredential(Credential credential)
Store credential of identity.boolean
verifyEvidence(Evidence evidence, Supplier<Provider[]> providers)
Verify the given evidence against the named credential.boolean
verifyEvidence(Evidence evidence, Supplier<Provider[]> providers, Charset hashCharset)
Verify the given evidence against the named credential.
-
-
-
Field Detail
-
context
private final DirContext context
-
distinguishedName
private final String distinguishedName
-
attributes
private final Attributes attributes
-
hashEncoding
private final Encoding hashEncoding
-
-
Constructor Detail
-
ForIdentityLoader
public ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes)
-
ForIdentityLoader
public ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes, Encoding hashEncoding)
-
-
Method Detail
-
getCredentialAcquireSupport
public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers)
Description copied from interface:IdentityCredentialLoader
Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.- Specified by:
getCredentialAcquireSupport
in interfaceIdentityCredentialLoader
- Parameters:
credentialType
- the credential type (must not benull
)credentialAlgorithm
- the credential algorithm name, if anyparameterSpec
- the algorithm parameters to match, ornull
if any parameters are acceptable or the credential type does not support algorithm parametersproviders
- the providers to use when checking ability to obtain the credential- Returns:
- the level of support for this credential type
-
getEvidenceVerifySupport
public SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String evidenceAlgorithm, Supplier<Provider[]> providers) throws RealmUnavailableException
Description copied from interface:IdentityEvidenceVerifier
Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.- Specified by:
getEvidenceVerifySupport
in interfaceIdentityEvidenceVerifier
- Parameters:
evidenceType
- the evidence type (must not benull
)evidenceAlgorithm
- the algorithm name, if anyproviders
- the providers to use when checking the ability to verify evidence.- Returns:
- the level of support for this credential type
- Throws:
RealmUnavailableException
- if the realm is unavailable to verify credentials.
-
verifyEvidence
public boolean verifyEvidence(Evidence evidence, Supplier<Provider[]> providers) throws RealmUnavailableException
Description copied from interface:IdentityEvidenceVerifier
Verify the given evidence against the named credential.- Specified by:
verifyEvidence
in interfaceIdentityEvidenceVerifier
- Parameters:
evidence
- the evidence to verify.providers
- the providers to use when verifying evidence.- Returns:
true
if the evidence is successfully verified,false
otherwise.- Throws:
RealmUnavailableException
- if the realm is unavailable to verify credentials.
-
getCredential
public <C extends Credential> C getCredential(Class<C> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers)
Description copied from interface:IdentityCredentialLoader
Acquire a credential of the given type.- Specified by:
getCredential
in interfaceIdentityCredentialLoader
- Type Parameters:
C
- the type to which should be credential casted- Parameters:
credentialType
- the credential type (must not benull
)credentialAlgorithm
- the credential algorithm name, if anyparameterSpec
- the algorithm parameters to match, ornull
if any parameters are acceptable or the credential type does not support algorithm parametersproviders
- the providers to use when obtaining the credential- Returns:
- the credential, or
null
if the principal has no credential of that name or cannot be casted to that type
-
verifyEvidence
public boolean verifyEvidence(Evidence evidence, Supplier<Provider[]> providers, Charset hashCharset) throws RealmUnavailableException
Description copied from interface:IdentityEvidenceVerifier
Verify the given evidence against the named credential.- Specified by:
verifyEvidence
in interfaceIdentityEvidenceVerifier
- Parameters:
evidence
- the evidence to verify.providers
- the providers to use when verifying evidence.hashCharset
- the name of the character set (must not benull
).- Returns:
true
if the evidence is successfully verified,false
otherwise.- Throws:
RealmUnavailableException
- if the realm is unavailable to verify credentials.
-
getCredentialPersistSupport
public boolean getCredentialPersistSupport(Class<? extends Credential> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec)
Description copied from interface:IdentityCredentialPersister
Determine whether a given credential type can be persisted by this credential persister.- Specified by:
getCredentialPersistSupport
in interfaceIdentityCredentialPersister
- Parameters:
credentialType
- the credential type (must not benull
)credentialAlgorithm
- the credential algorithm name, if anyparameterSpec
- the algorithm parameters to match, ornull
if any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
true
if persisting of given credential is supported
-
persistCredential
public void persistCredential(Credential credential) throws RealmUnavailableException
Description copied from interface:IdentityCredentialPersister
Store credential of identity.- Specified by:
persistCredential
in interfaceIdentityCredentialPersister
- Parameters:
credential
- the credential- Throws:
RealmUnavailableException
-
clearCredentials
public void clearCredentials() throws RealmUnavailableException
Description copied from interface:IdentityCredentialPersister
Clear all supported credentials of identity.- Specified by:
clearCredentials
in interfaceIdentityCredentialPersister
- Throws:
RealmUnavailableException
-
-