JAAS和Wildfly10

时间:2017-02-18 13:27:00

标签: tomcat jaas wildfly-10

我一直在尝试使用实现CustomLoginModule的自定义类(javax.security.auth.spi.LoginModule)并将其部署在wildfly 10中。我已将配置放在standalone.xml中,如下所示。我无法弄清楚为什么CustomLoginModule永远不会被调用。我已启用跟踪并能够确定从Wildfly10的模块目录中加载的类。

独立配置:

 <security-domain name="xxxx">
                    <authentication>
<login-module code="com.test.CustomLoginModule" flag="required">    
<module-option name="userQuery" value="select USER_ID from FH_USER_TE where USER_ID=? and PASSWORD=?"/>

<module-option name="roleQuery" value="select ROLE from FH_USER_TE where USER_ID=?"/>                       
</login-module>
</authentication>

如果我能在这里得到一些建议/建议,那就太好了。

同样在TOMCAT 8中完美运作

谢谢, Dwaipayan

1 个答案:

答案 0 :(得分:0)

I am able to invoke my CustomLoginModule Successfully by removing the jar from the modules directory of Wildfly 10. The .war bundles the CustomLoginModule class . I am not sure if this is the right way but it works. The options in CustomLoginModule although comes as "jboss.security.security_domain=fusionHiringLoginModule".

the sql queries have to be a part of module-option as below

<security-domain name="xxxxx" cache-type="default">
 <authentication>
 <login-module code="com.test.CustomLoginModule" flag="required">
<module-option name="userQuery" value="select userId from tableName where USER_ID=? and PASSWORD=?" />
<module-option name="roleQuery" value="select role from table where USER_ID=?"  />
</login-module>
</authentication>
</security-domain>

Thanks 

Dwaipayan