1

在验证我的应用程序的远程客户端时,如何配置 JBoss 7.1.1 服务器以使用 DatabaseServerLoginModule?

4

1 回答 1

0

创建一个包含 3 列的表:

rolename, username and password. (or with name you need)

在您的服务器 xml 中声明您的数据源,然后放置:

            <security-domain name="mydomain">
                <authentication>
                    <login-module code="Database" flag="required">
                        <module-option name="dsJndiName" value="java:jboss/datasources/MyDS"/>
                        <module-option name="principalsQuery" value="select password from tab_credential where username=?"/>
                        <module-option name="rolesQuery" value="select rolename, 'Roles' from tab_credential where username=?"/>
                        <module-option name="unauthenticatedIdentity" value="guest"/>
                    </login-module>
                </authentication>
            </security-domain>
于 2012-08-03T08:14:12.943 回答