我目前正在尝试将Active Directory身份验证集成到我在JBoss EAP 6.1上运行的java应用程序中。 LDAP连接工作正常并进行身份验证,但是我很难弄清楚如何将用户在Active Directory中附加到的组映射到应用程序中的角色。
调用Active Directory中的组。 GS_App_Teamleaders
我在我的web xml文件中设置了一个如下组,其中包含附加到该组的角色:
<security-constraint>
<display-name>TeamLeaders</display-name>
<web-resource-collection>
<web-resource-name>TeamLeaders</web-resource-name>
<description>The reporting functionality</description>
<url-pattern>/jsp/layout/useDisplayMIActionRequests.jsp</url-pattern>
<url-pattern>/jsp/layout/useDisplayMIActionRequestsPrint.jsp</url-pattern>
<url-pattern>/jsp/layout/useDisplayMIPostcodeBreakdown.jsp</url-pattern>
<url-pattern>/jsp/layout/useDisplayMIPostcodeBreakdownPrint.jsp</url-pattern>
<url-pattern>/jsp/layout/useDisplayMIPreferredDay.jsp</url-pattern>
<url-pattern>/jsp/layout/useDisplayMIPreferredDayPrint.jsp</url-pattern>
<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>TotalsReporter</role-name>
<role-name>ReceivedReporter</role-name>
<role-name>PostcodeReporter</role-name>
<role-name>PremiumsReporter</role-name>
<role-name>UnpaidsReporter</role-name>
<role-name>ArrearsReporter</role-name>
<role-name>PerformanceReporter</role-name>
<role-name>TransactionsReporter</role-name>
</auth-constraint>
</security-constraint>
在我的standalone.xml文件中,我有以下代码通过活动目录进行身份验证,我正在努力了解如何将活动目录组映射到JBoss EAP中的角色。
<security-domain name="ldap">
<authentication>
<login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
<module-option name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory"/>
<module-option name="java.naming.security.authentication" value="simple"/>
<module-option name="java.naming.provider.url" value="ldap://localhost:389"/>
<module-option name="rolesCtxDN" value="OU=Users,OU=GroupFunctions,DC=domain,DC=com"/>
<module-option name="roleAttributeID" value="memberOf"/>
<module-option name="roleAttributeIsDN" value="true"/>
<module-option name="roleNameAttributeID" value="cn"/>
<module-option name="uidAttributeID" value="member"/>
<module-option name="matchOnUserDN" value="true"/>
<module-option name="allowEmptyPasswords" value="false"/>
</login-module>
</authentication>
</security-domain>
有人可以帮忙吗?
感谢。
丹·拉尔夫斯