Hi Team,
Earlier WildFly 19 version, we configured "io.undertow.servlet.handlers.security.ServletFormAuthenticationMechanism" for form based authentication and it's used to work as expected.
Now we are upgrading to latest version WildFly 26.1.1
As part of this activity, we started using "org.wildfly.security.mechanism.http.UsernamePasswordAuthenticationMechanism"
Our Application deployed as expected and we are getting the login page as expected.
Once the username and password is provided, call is coming to "UsernamePasswordAuthenticationMechanism::authenticate" as expected.
However, we are not landing to the application home page after login. we are getting error "This page isn’t working
Any help in this regard is greatly appreciated as we are heading towards the release and it's blocking us to move forward.
Our configuration is:
Web.xml
Step 1:
<login-config>
<auth-method>custom-mechanism</auth-method>
<realm-name>itpam</realm-name>
<form-login-config>
<form-login-page>/LoginForm.jsp</form-login-page>
<form-error-page>/LoginError.jsp</form-error-page>
</form-login-config>
</login-config>
Step 2:
public class CustomMechanismFactory implements HttpServerAuthenticationMechanismFactory {
...
@Override
public HttpServerAuthenticationMechanism createAuthenticationMechanism(String name, Map<String, ?> properties,
CallbackHandler handler) throws HttpAuthenticationException {
if (CUSTOM_NAME.equals(name)) {
return new C2OFormAuthenticationMechanism(handler, properties);
}
return null;
}
}
"
Step 3:
C2OFormAuthenticationMechanism implements the UsernamePasswordAuthenticationMechanism
Step 4:
standalone-full-ha.xml changes
<http>
.....
<http-authentication-factory name="custom-mechanism" security-domain="EEM" http-server-mechanism-factory="custom-factory">
<mechanism-configuration>
<mechanism mechanism-name="custom-mechanism"/>
</mechanism-configuration>
</http-authentication-factory>
</http>
For elytron subsystem
<http-authentication-factory name="custom-mechanism" security-domain="EEM" http-server-mechanism-factory="custom-factory">
<mechanism-configuration>
<mechanism mechanism-name="custom-mechanism"/>
</mechanism-configuration>
</http-authentication-factory>
Thanks & Regards,
Madhava