Access JasperReports Server using LDAP

We had a few issues getting to the bottom of how to add the LDAP functionality to JasperReports.

So here is how we did it:

Open ‘applicationContext-security.xml‘ which is located in:
/usr/local/glassfish3.1.2/glassfish/domains/domain1/autodeploy/jasperserver.war/WEB-INF

This is where it is if you’ve followed our earlier blog post, how to deploy JasperReports Server 4.0 on Glassfish 3.1/3.2.

If you didn’t then it’ll be located within your JasperReports directory somewhere.

Changes:

To help you find what needs to be changed, download my version of the applicationContext-security.xml file and use some file comparing software to note the changes from the original version.

There are changes on lines:

  • 14: Unremarked the “ldapAuthenticationProvider” line.
  • 78: Enter your LDAP host “ldap://blah.blah.co.uk:3286”.
  • 83: Enter username/email address/account name here.
  • 84: Enter the password to the above account on this line.
  • 93: Enter the domain content ‘DC’ structure for your LDAP directory.

i.e.
DC=staff,DC=google,DC=co,DC=uk

Apache Directory Studio will help test the above configuration & help you find your LDAP host, ‘DC’ structure, using its search features.

Once you’ve made the changes to this file, start up Glassfish again and you will be able to login using your corporate account.

*Things to note, if you have a local account in JasperReports with the same name as the account that you’re trying to access from LDAP, access will only be granted using the local password that was set to this account – Not a password coming from your LDAP host.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s