<security-domain name="EEM" default-realm="EiamCustomRealm" permission-mapper="default-permission-mapper">
<realm name="EiamCustomRealm"/>
</security-domain>
---
<jaas-realm name="EiamCustomRealm" entry="EiamAuth" module="com.pam.login" callback-handler="com.login.ITPAMEiamCallbackHandler">
<file path="${jboss.server.base.dir}/../modules/system/layers/base/com/pam/login/main/JAAS-login-modules.conf"/>
</jaas-realm>
----
public class ITPAMEiamCallbackHandler implements CallbackHandler {
..}
And our form authentication is extending the UsernamePasswordAuthenticationMechanism
public class FormAuthenticationMechanism extends UsernamePasswordAuthenticationMechanism {
}
-------------------------------------------------------------------
So, we are facing a few issues with custom authentication.
Can I request someone to provide the sample application for UsernamePasswordAuthenticationMechanism?
And What's the the parameters to be passed for the "authenticate" method of "UsernamePasswordAuthenticationMechanism".
When we are passing the security realm name and username and password we are getting the following error.
if (authenticate("EiamCustomRealm", username, password.toCharArray()))
ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /itpam/Web.jsp: java.lang.IllegalArgumentException: ELY01092: Invalid mechanism realm selection "EiamCustomRealm"
at org.wildfly.security.auth.server.ServerAuthenticationContext$InitialState.setMechanismRealmName(ServerAuthenticationContext.java:1808)
at org.wildfly.security.auth.server.ServerAuthenticationContext.setMechanismRealmName(ServerAuthenticationContext.java:835)
at org.wildfly.security.auth.server.ServerAuthenticationContext$1.handleOne(ServerAuthenticationContext.java:1089)
at org.wildfly.security.auth.server.ServerAuthenticationContext$1.handle(ServerAuthenticationContext.java:868)
at org.wildfly.security.auth.server.SecurityIdentityServerMechanismFactory$SecurityIdentityCallbackHandler.handle(SecurityIdentityServerMechanismFactory.java:126)
at org.wildfly.security.mechanism.http.UsernamePasswordAuthenticationMechanism.authenticate(UsernamePasswordAuthenticationMechanism.java:78)
at com.broadcom.pam.auth.C2OFormAuthenticationMechanism.evaluateRequest(C2OFormAuthenticationMechanism.java:175)
Thanks & Regards
Madhava
+91 995 996 3 997