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 Attributesattributesprivate DirContextcontextprivate StringdistinguishedNameprivate EncodinghashEncoding
-
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 voidclearCredentials()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.SupportLevelgetCredentialAcquireSupport(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.booleangetCredentialPersistSupport(Class<? extends Credential> credentialType, String credentialAlgorithm, AlgorithmParameterSpec parameterSpec)Determine whether a given credential type can be persisted by this credential persister.SupportLevelgetEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String evidenceAlgorithm, Supplier<Provider[]> providers)Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.voidpersistCredential(Credential credential)Store credential of identity.booleanverifyEvidence(Evidence evidence, Supplier<Provider[]> providers)Verify the given evidence against the named credential.booleanverifyEvidence(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:IdentityCredentialLoaderDetermine whether a given credential is definitely supported, possibly supported, or definitely not supported.- Specified by:
getCredentialAcquireSupportin interfaceIdentityCredentialLoader- Parameters:
credentialType- the credential type (must not benull)credentialAlgorithm- the credential algorithm name, if anyparameterSpec- the algorithm parameters to match, ornullif 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:IdentityEvidenceVerifierDetermine whether a given credential is definitely supported, possibly supported, or definitely not supported.- Specified by:
getEvidenceVerifySupportin 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:IdentityEvidenceVerifierVerify the given evidence against the named credential.- Specified by:
verifyEvidencein interfaceIdentityEvidenceVerifier- Parameters:
evidence- the evidence to verify.providers- the providers to use when verifying evidence.- Returns:
trueif the evidence is successfully verified,falseotherwise.- 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:IdentityCredentialLoaderAcquire a credential of the given type.- Specified by:
getCredentialin 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, ornullif 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
nullif 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:IdentityEvidenceVerifierVerify the given evidence against the named credential.- Specified by:
verifyEvidencein 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:
trueif the evidence is successfully verified,falseotherwise.- 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:IdentityCredentialPersisterDetermine whether a given credential type can be persisted by this credential persister.- Specified by:
getCredentialPersistSupportin interfaceIdentityCredentialPersister- Parameters:
credentialType- the credential type (must not benull)credentialAlgorithm- the credential algorithm name, if anyparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
trueif persisting of given credential is supported
-
persistCredential
public void persistCredential(Credential credential) throws RealmUnavailableException
Description copied from interface:IdentityCredentialPersisterStore credential of identity.- Specified by:
persistCredentialin interfaceIdentityCredentialPersister- Parameters:
credential- the credential- Throws:
RealmUnavailableException
-
clearCredentials
public void clearCredentials() throws RealmUnavailableExceptionDescription copied from interface:IdentityCredentialPersisterClear all supported credentials of identity.- Specified by:
clearCredentialsin interfaceIdentityCredentialPersister- Throws:
RealmUnavailableException
-
-