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 ClassesModifier and TypeClassDescriptionprotected static class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory) -
Method Summary
Modifier and TypeMethodDescriptioncreateMechanism(String name, UnaryOperator<F> factoryTransformation) Create the mechanism instance.protected abstract MdoCreate(String name, CallbackHandler callbackHandler, UnaryOperator<F> factoryTransformation) protected abstract Collection<String>Get the actual factory used for instantiation.Get the collection of mechanism names may be supported by this factory.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, waitMethods inherited from interface org.wildfly.security.auth.server.MechanismAuthenticationFactory
createMechanism
-
Constructor Details
-
AbstractMechanismAuthenticationFactory
protected AbstractMechanismAuthenticationFactory(SecurityDomain securityDomain, MechanismConfigurationSelector mechanismConfigurationSelector, F factory)
-
-
Method Details
-
getMechanismConfigurationSelector
-
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
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
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 failed
-
doCreate
protected abstract M doCreate(String name, CallbackHandler callbackHandler, UnaryOperator<F> factoryTransformation) throws E -
getSupportedEvidenceTypes
-
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
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
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
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
-