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>
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 classAbstractMechanismAuthenticationFactory.Builder<M,F,E extends Exception>
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description McreateMechanism(String name, UnaryOperator<F> factoryTransformation)Create the mechanism instance.protected abstract MdoCreate(String name, CallbackHandler callbackHandler, UnaryOperator<F> factoryTransformation)protected abstract Collection<String>getAllSupportedMechNames()FgetFactory()Get the actual factory used for instantiation.MechanismConfigurationSelectorgetMechanismConfigurationSelector()Collection<String>getMechanismNames()Get the collection of mechanism names may be supported by this factory.SecurityDomaingetSecurityDomain()Get the underlyingSecurityDomainthat 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 booleanisKnownMechanism(String mechName)Determine whether the given mechanism name is known to WildFly Elytron.protected abstract booleanusesCredentials(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
-
-
-
-
Constructor Detail
-
AbstractMechanismAuthenticationFactory
protected AbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory)
-
-
Method Detail
-
getMechanismConfigurationSelector
public MechanismConfigurationSelector getMechanismConfigurationSelector()
-
getSecurityDomain
public SecurityDomain getSecurityDomain()
Description copied from interface:MechanismAuthenticationFactoryGet the underlyingSecurityDomainthat mechanisms created by this factory will be using for authentication.- Specified by:
getSecurityDomainin interfaceMechanismAuthenticationFactory<M,F,E extends Exception>- Returns:
- the underlying
SecurityDomainthat mechanisms created by this factory will be using for authentication.
-
getFactory
public F getFactory()
Description copied from interface:MechanismAuthenticationFactoryGet the actual factory used for instantiation.- Specified by:
getFactoryin 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:MechanismAuthenticationFactoryCreate the mechanism instance.- Specified by:
createMechanismin 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
nullif 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:
trueif the mechanism requires realm credential support,falseif it does not
-
isKnownMechanism
protected boolean isKnownMechanism(String mechName)
Determine whether the given mechanism name is known to WildFly Elytron. If it is not known we can't filter it out as we can not rely upon the other methods being able to return accurate responses about the mechanisms requirements. As this is a new method and other implementations may not know to override this has a default implementation to match the current behaviour i.e. assume we know about all mechanisms.- Parameters:
mechName- the mechanism name- Returns:
trueif the mechanism is known to WildFly Elytron,falseif it is not
-
getMechanismNames
public Collection<String> getMechanismNames()
Description copied from interface:MechanismAuthenticationFactoryGet 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:
getMechanismNamesin interfaceMechanismAuthenticationFactory<M,F,E extends Exception>- Returns:
- the mechanism names (not
null)
-
getAllSupportedMechNames
protected abstract Collection<String> getAllSupportedMechNames()
-
-