Wednesday 30 December 2015

Jasper reporting server - AD authentication configuration


solved - resolved my issue with jasper report server ldap and ad authentication and everything working from AD now. observe and fine tune configurations highlighted in blue and with yellow fonts. if you get highlighted configs correct then your AD authentication should work out of box.


# vi /opt/jasperreports-server/apache-tomcat/webapps/jasperserver-pro/WEB-INF/applicationContext-externalAuth-LDAP-mt.xml



<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="userSearch" ref="userSearch"/>
            </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>
                <constructor-arg index="1"><value>OU=Jasper,OU=ApplicationGroups,OU=casps</value></constructor-arg>
                <property name="groupRoleAttribute"><value>CN</value></property>
                <property name="rolePrefix"><value></value></property>
                <property name="groupSearchFilter" value="(&amp;(member={0})(objectclass=group)(CN=JASPER_*))"/>
                <property name="searchSubtree" value="true"/>
            </bean>
        </constructor-arg>
    </bean>




<bean id="userSearch" class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.ldap.JSFilterBasedLdapUserSearch">
  <constructor-arg index="0"><value>OU=casps-Global,OU=Standard,OU=Users,OU=casps</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>




    <bean id="ldapContextSource" class="com.jaspersoft.jasperserver.api.security.externalAuth.ldap.JSLdapContextSource">
        <constructor-arg value="ldaps://ldap-PROD-dc.caspsech.com:636/DC=casps,DC=com"/>
        <!-- manager user name and password (may not be needed)  -->
        <property name="userDn" value="CN=svcjasper,CN=Managed Service Accounts,DC=casps,DC=com"/>
        <property name="password" value="ENCRYPTED_PASSWORD"/>
        <property name="referral" value="follow"/>
    </bean>