Jump to content

Anyone have JasperServer 4.5 Community Edition authenticating with Windows 2008 R2 Active Directory?


gedmf

Recommended Posts

 I have trawled the posts in JasperForge and Spring security for pointers to solve the problem of Jasper Server 4.5 Community Edition authentication with Active Directory on Windows 2008 R2.

 
Lots of people have a working solution for earlier versions of Jasper or with Active Directory 2003.
 
Does anybody have 4.5 CE working with AD 2008 R2 who would be willing to share extracts from the applicationContext-security.xml
 
Almost irrespective of how I configure, the log messages are the same:
 
2012-04-29 07:21:13,457 DEBUG BindAuthenticator,http-8080-1:106 - Attemptimg to bind as uid=username,dc=domain,dc=co,dc=uk2012-04-29 07:21:13,457 DEBUG BindAuthenticator,http-8080-1:106 - Attemptimg to bind as uid=username,dc=domain,dc=co,dc=uk2012-04-29 07:21:13,648  WARN LoggerListener,http-8080-1:60 - Authentication event AuthenticationFailureBadCredentialsEvent: username; details: org.springframework.security.ui.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 192.168.4.188; SessionId: 0E34083AF0B7D326725CEAAC0D9EB9E6; exception: Bad credentials

 
This is an extract from the current configuration, though many variants have been tried.
 
   <!-- ======================== AUTHENTICATION ======================= -->    <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">        <property name="providers">		<list>                <ref local="ldapAuthenticationProvider"/>                 <ref bean="${bean.daoAuthenticationProvider}"/>                <ref bean="anonymousAuthenticationProvider"/>                <!--ref local="jaasAuthenticationProvider"/-->            </list>        </property>    </bean>        <!--  ***************************** LDAP authentication START **************************************** -->      <bean id="ldapContextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">		<constructor-arg value="ldap://ADSERVER:389/DC=domain, DC=co, DC=uk"/>          		<property name="userDn">			<value>CN=LDAPQueryUser,OU=XXXXX,OU=YYYYY,OU=ZZZZZ,DC=domain,DC=co,DC=uk</value>		</property>     		<property name="password">			<value>s3cr3t#</value>		</property>	</bean>   	<bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">		<constructor-arg index="0"> 			<value>OU=YYYYY</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="ldapAuthenticationProvider" class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">		<constructor-arg>			<bean class="org.springframework.security.providers.ldap.authenticator.BindAuthenticator">				<constructor-arg>					<ref local="ldapContextSource"/>				</constructor-arg>				<property name="userDnPatterns">					<list>						<value>(sAMAccountName={0})</value>					</list>				</property>				<property name="userSearch" ref="userSearch"/> 			</bean>		</constructor-arg>		<constructor-arg>			<bean class="org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator">				<constructor-arg index="0">					<ref local="ldapContextSource"/>				</constructor-arg>				<constructor-arg index="1">					<value>OU=Groups</value>				</constructor-arg>				<property name="groupRoleAttribute">					<value>CN</value>				</property>				<property name="groupSearchFilter">					<value>(member={0}(CN=*)</value>				</property>				<property name="searchSubtree">					<value>true</value>				</property> 				<property name="defaultRole">					<value>ROLE_USER</value>				</property> 			</bean>		</constructor-arg>	</bean>    <!--  ***************************** LDAP authentication END **************************************** -->

 
Link to comment
Share on other sites

  • 1 month later...
  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...

 I have the same issue.

 

Many problems to connect JS CE 4.5 to W2k8 R2.

 

I have tried applicationcontext-security.xml settings from shmee without any success.

 

Always I got the same message:

 

2012-07-19 07:54:00,620 DEBUG AuthenticationProcessingFilter,http-8080-2:412 - Authentication request failed: org.springframework.security.BadCredentialsException: Bad credentials

 

gedmf , did you get any fix for your issue?.

 

Regards

Link to comment
Share on other sites

 Hi,

Yes I did get it working.  I have attached an extract from the applicationContext-security.xml file, so that you can see how the beans are configured.

The thing that caused me problems and delay was a bit of a "school-boy error".  I saved  the original xml file as applicationContext-security_orig.xml in the WEB-INF directory, while working on a copy.  During the course of the work I also had other versions as backups.  I couldn't understand why some of my efforts to change the configuration were ignored and others applied.  Then it clicked.  All of the versions - intended and backups - were being loaded, so the bean settings would always be the last file loaded.  I moved the backups to another directory and got it working fairly quickly.

Hope this helps.  If not, please get in touch with further questions.

-Ged

Link to comment
Share on other sites

 Hi Ged,

 

I was making the same "school-boy error". I had three versions of  the file with the same prefix "applicationContext-security"

 

You have made a happy day for me today :-).

 

Next beer I have, it will be in your honor ;-)

 

Thanks a lot.

 

Bye.

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...