External database authentication in JasperServer 5.1


For the past week I've been struggling to log in using credentials stored in an external database. I have modified and deployed the sample applicationContext-externalAuth-db.xml, as mentioned in the jasperreportsserver-auth-cookbook, but when i try to log in, i get a bad credentials exception. Do you have any suggestion on how to get the external database authentication working ? 

I have to mention that the password is stored as plain text in my external database.

Thank you,


dcristea's picture
Joined: Jun 25 2013 - 5:32am
Last seen: 10 years 1 week ago

1 Answer:

If you are using plaintext, remove the reference to the passwordValidator bean in externalDaoAuthenticationProvider:

<bean id="externalDaoAuthenticationProvider" class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.db.MTExternalDaoAuthenticationProvider">
        <property name="userDetailsService"><ref local="externalUserTenantDetailsService"/></property>
        <property name="passwordValidator"><ref local="passwordValidator"/></property>

This example is from a pro file - the class might be slightly different in community. So make sure to edit your file & not copy this.


elizam's picture
Joined: Mar 5 2012 - 9:19am
Last seen: 3 years 1 month ago

Thank you for your reply. It seems like the root of my problem was an issue with the authoritiesByUsernameQuery. I would like to ask you if there is any way for me to see the "usersByUsernameQuery" and the "authoritiesByUsernameQuery" queries in the jasperserver log.

dcristea - 10 years 1 month ago

Just saw this - you can enable additional logging as described here:

elizam - 9 years 8 months ago