我已经建立了一个带有2个登录模块的安全域,如您所见:
<security-domain name="myDomain" cache-type="default">
<authentication>
<login-module code="Database" flag="sufficient">
<module-option name="dsJndiName" value="java:/jdbc/hrdb"/>
<module-option name="principalsQuery" value="select TRIM(CDPASS) from XXXXXXX"/>
<module-option name="rolesQuery" value="select TRIM(ROLES),'Roles' from XXXXXX"/>
<module-option name="unauthenticatedIdentity" value="guest"/>
</login-module>
<login-module name="Database-2" code="Database" flag="sufficient">
<module-option name="dsJndiName" value="java:/jdbc/hrdb"/>
<module-option name="principalsQuery" value="select TRIM(CDPASS) XXXXXX"/>
<module-option name="rolesQuery" value="select TRIM(ROLES),'Roles' from XXXXXX"/>
<module-option name="unauthenticatedIdentity" value="guest"/>
</login-module>
</authentication>
</security-domain>
它正确地使用这两个模块登录但我想在我的java应用程序中知道是否有方法来识别用户连接的模块?