gedmf Posted April 29, 2012 Share Posted April 29, 2012 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 More sharing options...
shmee Posted June 26, 2012 Share Posted June 26, 2012 I don't know if you fixed your issue yet but here is my file (with names changed for security of coarse). And I am using Windows 2008R2 and JasperServer4.5. Link to comment Share on other sites More sharing options...
mapergom Posted July 19, 2012 Share Posted July 19, 2012 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 More sharing options...
gedmf Posted July 19, 2012 Author Share Posted July 19, 2012 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 More sharing options...
gedmf Posted July 19, 2012 Author Share Posted July 19, 2012 Hi Shmee, I did get it working. Sorry about the late reply, I forgot to monitor the thread. Thank you for taking the time to post. -Ged Link to comment Share on other sites More sharing options...
mapergom Posted July 19, 2012 Share Posted July 19, 2012 Thanks a lot for your quick reply. I will take a look to your file. Regards. Link to comment Share on other sites More sharing options...
mapergom Posted July 19, 2012 Share Posted July 19, 2012 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 More sharing options...
gedmf Posted July 19, 2012 Author Share Posted July 19, 2012 You are welcome. Good luck with the rest of your project. -Ged Link to comment Share on other sites More sharing options...
shmee Posted July 20, 2012 Share Posted July 20, 2012 I am glad that you got it working. Link to comment Share on other sites More sharing options...
bothunbr Posted October 19, 2012 Share Posted October 19, 2012 The file is no longer attached to this post. Is there any way you could post it again? Link to comment Share on other sites More sharing options...
pumaking Posted October 23, 2012 Share Posted October 23, 2012 Would be interesting for me too. Link to comment Share on other sites More sharing options...
brenwhyte Posted April 16, 2013 Share Posted April 16, 2013 Hi, any chance you could post/paste bin your configuration again shmee? Pulling my hair put with this one. Thanks in advance! Link to comment Share on other sites More sharing options...
brenwhyte Posted April 16, 2013 Share Posted April 16, 2013 I can't see the attachment I'm afraid. Any chance you could post it up? Thanks Link to comment Share on other sites More sharing options...
czupet Posted May 1, 2013 Share Posted May 1, 2013 I am having the same issue with JapserReports 5.0 Can you re-post the file again, it's no longer attached to the post? Thank You Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now