我正在尝试使用ActiveDirectory对JasperServer进行身份验证,但仍然因某些原因无法运行:
这是我的配置:
1。第1步:访问AD服务器的参数:
<bean id="ldapContextSource" class="com.jaspersoft.jasperserver.api.security.externalAuth.ldap.JSLdapContextSource">
<constructor-arg value="ldap://192.10.0.190:389/dc=sifast,dc=infra"/>
<!-- manager user name and password (may not be needed) -->
<property name="userDn" value="CN=recherche,CN=Users,DC=sifast,DC=infra"/>
<property name="password" value="*******"/>
<property name="referral">
<value>follow</value>
</property>
</bean>
2.STEP 2:“userDnPatterns”中访问权限的配置: 在这里,我想访问已经输入的登录
<bean id="ldapAuthenticationProvider" class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.ldap.JSLdapAuthenticationProvider">
<constructor-arg>
<bean class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.ldap.JSBindAuthenticator">
<constructor-arg><ref local="ldapContextSource"/></constructor-arg>
<property name="userDnPatterns">
<list>
<value>CN={0},CN=Users,DC=sifast,DC=infra</value>
</list>
</property>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.ldap.JSDefaultLdapAuthoritiesPopulator">
<constructor-arg index="0"><ref local="ldapContextSource"/></constructor-arg>
</bean>
所以我在这里设置: CN = {0},CN = Users,DC = sifast,DC = infra
第3。第3步:配置userSearch方法:
<bean id="userSearch"
class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.ldap.JSFilterBasedLdapUserSearch">
<constructor-arg index="0">
<value></value>
</constructor-arg>
<constructor-arg index="1">
<value>(sAMAccountName={0})</value>
</constructor-arg>
<constructor-arg index="2">
<ref local="ldapContextSource" />
</constructor-arg>
<property name="searchSubtree">
<value>true</value>
</property>
</bean>
这里我使用登录名“({0})”来查找合适用户的类似 sAMAccountName 。
仍然无效。
我的AD架构如下所示: 所以我想让CN = USERS中的简单用户获得访问权限
实际上我的身份验证仍然失败。有什么想法吗?
答案 0 :(得分:0)
在您的步骤2中,spring配置文件JSBindAuthenticator缺少以下属性引用:
<property name="userSearch" ref="userSearch"/>