Class OtpCredentialLoader.ForIdentityLoader
- java.lang.Object
-
- org.wildfly.security.auth.realm.ldap.OtpCredentialLoader.ForIdentityLoader
-
- All Implemented Interfaces:
IdentityCredentialLoader
,IdentityCredentialPersister
- Enclosing class:
- OtpCredentialLoader
private class OtpCredentialLoader.ForIdentityLoader extends Object implements IdentityCredentialPersister
-
-
Field Summary
Fields Modifier and Type Field Description private Attributes
attributes
private DirContext
context
private String
distinguishedName
-
Constructor Summary
Constructors Constructor Description ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes)
-
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 algorithmName, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers)
Acquire a credential of the given type.SupportLevel
getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, 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 algorithmName, AlgorithmParameterSpec parameterSpec)
Determine whether a given credential type can be persisted by this credential persister.void
persistCredential(Credential credential)
Store credential of identity.
-
-
-
Field Detail
-
context
private final DirContext context
-
distinguishedName
private final String distinguishedName
-
attributes
private final Attributes attributes
-
-
Constructor Detail
-
ForIdentityLoader
public ForIdentityLoader(DirContext context, String distinguishedName, Attributes attributes)
-
-
Method Detail
-
getCredentialAcquireSupport
public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, 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
)algorithmName
- 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
-
getCredential
public <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, 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
)algorithmName
- 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
-
getCredentialPersistSupport
public boolean getCredentialPersistSupport(Class<? extends Credential> credentialType, String algorithmName, 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
)algorithmName
- 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
-
-