Search code examples
authenticationactive-directoryldapwindows-authenticationjasperserver

Authenticating JasperServer 6.3 with active directory not WORKING


I'm trying to use ActiveDirectory to authenticate to JasperServer , that still not working for some reason :

here is my configuration :

1. STEP 1 : access params to the AD Server :

   <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: configuration of the access within "userDnPatterns" : here i wanna access with the login already entered

   <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>

so here i'm setting it within that : CN={0},CN=Users,DC=sifast,DC=infra

3. STEP 3 : configuring the userSearch method:

   <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>

here i'm using the login "({0})" entered to look for the similar sAMAccountName of the right user.

that still not working.

my AD Schema looks like this: so i wanna let simple users inside CN=USERS acquire access enter image description here

Actually my authentication is still failing. Any ideas?


Solution

  • In your step 2 spring configuration file JSBindAuthenticator missing the following property reference:

    <property name="userSearch" ref="userSearch"/>