Package org.wildfly.security.auth.server
Class AbstractMechanismAuthenticationFactory<M,F,E extends Exception>
- java.lang.Object
-
- org.wildfly.security.auth.server.AbstractMechanismAuthenticationFactory<M,F,E>
-
- All Implemented Interfaces:
MechanismAuthenticationFactory<M,F,E>
- Direct Known Subclasses:
HttpAuthenticationFactory
,HttpAuthenticationFactory
,SaslAuthenticationFactory
,SaslAuthenticationFactory
public abstract class AbstractMechanismAuthenticationFactory<M,F,E extends Exception> extends Object implements MechanismAuthenticationFactory<M,F,E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractMechanismAuthenticationFactory.Builder<M,F,E extends Exception>
-
Field Summary
Fields Modifier and Type Field Description private F
factory
private MechanismConfigurationSelector
mechanismConfigurationSelector
private SecurityDomain
securityDomain
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description M
createMechanism(String name, UnaryOperator<F> factoryTransformation)
Create the mechanism instance.protected abstract M
doCreate(String name, CallbackHandler callbackHandler, UnaryOperator<F> factoryTransformation)
protected abstract Collection<String>
getAllSupportedMechNames()
F
getFactory()
Get the actual factory used for instantiation.Collection<String>
getMechanismNames()
Get the collection of mechanism names may be supported by this factory.SecurityDomain
getSecurityDomain()
Get the underlyingSecurityDomain
that mechanisms created by this factory will be using for authentication.protected abstract Collection<String>
getSupportedCredentialAlgorithmNames(Class<? extends AlgorithmCredential> credentialType, String mechName)
protected abstract Collection<Class<? extends Credential>>
getSupportedCredentialTypes(String mechName)
protected abstract Collection<String>
getSupportedEvidenceAlgorithmNames(Class<? extends AlgorithmEvidence> evidenceType, String mechName)
protected abstract Collection<Class<? extends Evidence>>
getSupportedEvidenceTypes(String mechName)
protected abstract boolean
usesCredentials(String mechName)
Determine whether the given mechanism name needs credentials from a realm in order to authenticate.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.auth.server.MechanismAuthenticationFactory
createMechanism
-
-
-
-
Field Detail
-
securityDomain
private final SecurityDomain securityDomain
-
mechanismConfigurationSelector
private final MechanismConfigurationSelector mechanismConfigurationSelector
-
factory
private final F factory
-
-
Constructor Detail
-
AbstractMechanismAuthenticationFactory
protected AbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory)
-
-
Method Detail
-
getSecurityDomain
public SecurityDomain getSecurityDomain()
Description copied from interface:MechanismAuthenticationFactory
Get the underlyingSecurityDomain
that mechanisms created by this factory will be using for authentication.- Specified by:
getSecurityDomain
in interfaceMechanismAuthenticationFactory<M,F,E extends Exception>
- Returns:
- the underlying
SecurityDomain
that mechanisms created by this factory will be using for authentication.
-
getFactory
public F getFactory()
Description copied from interface:MechanismAuthenticationFactory
Get the actual factory used for instantiation.- Specified by:
getFactory
in interfaceMechanismAuthenticationFactory<M,F,E extends Exception>
- Returns:
- the actual factory (not
null
)
-
createMechanism
public M createMechanism(String name, UnaryOperator<F> factoryTransformation) throws E extends Exception
Description copied from interface:MechanismAuthenticationFactory
Create the mechanism instance.- Specified by:
createMechanism
in interfaceMechanismAuthenticationFactory<M,F,E extends Exception>
- Parameters:
name
- the mechanism name (must not benull
)factoryTransformation
- the transformation to apply to the factory (must not benull
)- Returns:
- the mechanism, or
null
if the mechanism with the given name is not supported - Throws:
E
- if the mechanism instantiation failedE extends Exception
-
doCreate
protected abstract M doCreate(String name, CallbackHandler callbackHandler, UnaryOperator<F> factoryTransformation) throws E extends Exception
-
getSupportedEvidenceTypes
protected abstract Collection<Class<? extends Evidence>> getSupportedEvidenceTypes(String mechName)
-
getSupportedEvidenceAlgorithmNames
protected abstract Collection<String> getSupportedEvidenceAlgorithmNames(Class<? extends AlgorithmEvidence> evidenceType, String mechName)
-
getSupportedCredentialTypes
protected abstract Collection<Class<? extends Credential>> getSupportedCredentialTypes(String mechName)
-
getSupportedCredentialAlgorithmNames
protected abstract Collection<String> getSupportedCredentialAlgorithmNames(Class<? extends AlgorithmCredential> credentialType, String mechName)
-
usesCredentials
protected abstract boolean usesCredentials(String mechName)
Determine whether the given mechanism name needs credentials from a realm in order to authenticate.- Parameters:
mechName
- the mechanism name- Returns:
true
if the mechanism requires realm credential support,false
if it does not
-
getMechanismNames
public Collection<String> getMechanismNames()
Description copied from interface:MechanismAuthenticationFactory
Get the collection of mechanism names may be supported by this factory. The actual set of available mechanisms depends on run-time factors but will generally not be greater than this collection.- Specified by:
getMechanismNames
in interfaceMechanismAuthenticationFactory<M,F,E extends Exception>
- Returns:
- the mechanism names (not
null
)
-
getAllSupportedMechNames
protected abstract Collection<String> getAllSupportedMechNames()
-
-