diff --git a/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java b/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
+++ b/core/src/main/java/io/undertow/util/ImmediateAuthenticationMechanismFactory.java
@@ -20,6 +20,6 @@ public class ImmediateAuthenticationMechanismFactory implements AuthenticationMe
 
     @Override
     public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
-        return null;
+        return authenticationMechanism;
     }
 }
Fixed NPE and problem in which custom AuthenticationMechanisms aren't used

The DeploymentInfo wraps an AuthenticationMechanism with a
ImmediateAuthenticationMechanismFactory.  However, that factory always returns
null when create() is called.  Fix is to simply returns the AuthenticationMechanism
that was provided to it during construction.