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>
  • Constructor Details

  • Method Details

    • getMechanismConfigurationSelector

      public MechanismConfigurationSelector getMechanismConfigurationSelector()
    • getSecurityDomain

      public SecurityDomain getSecurityDomain()
      Description copied from interface: MechanismAuthenticationFactory
      Get the underlying SecurityDomain that mechanisms created by this factory will be using for authentication.
      Specified by:
      getSecurityDomain in interface MechanismAuthenticationFactory<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 interface MechanismAuthenticationFactory<M,F,E extends Exception>
      Returns:
      the actual factory (not null)
    • createMechanism

      public M createMechanism(String name, UnaryOperator<F> factoryTransformation) throws E
      Description copied from interface: MechanismAuthenticationFactory
      Create the mechanism instance.
      Specified by:
      createMechanism in interface MechanismAuthenticationFactory<M,F,E extends Exception>
      Parameters:
      name - the mechanism name (must not be null)
      factoryTransformation - the transformation to apply to the factory (must not be null)
      Returns:
      the mechanism, or null if 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
      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
    • 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:
      true if the mechanism is known to WildFly Elytron, false if it is 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 interface MechanismAuthenticationFactory<M,F,E extends Exception>
      Returns:
      the mechanism names (not null)
    • getAllSupportedMechNames

      protected abstract Collection<String> getAllSupportedMechNames()