views:

169

answers:

1

I use the SpringSecurity-framework for authentication, and it works as long as there is a user with the same name in my local DB.

However, I want an admin-account that is only stored in the local DB and has no equivalent in LDAP.

So, how can I configure SpringSecurity so that it uses LDAP and if this fails looks for a user and password in the local DB?

+1  A: 

After hours of digging through google search results, source-code and documentation, I finally got it!

Just set the providers you want in your SecurityConfig.groovy


    providerNames = ['daoAuthenticationProvider',
                     'ldapAuthProvider']

Please note, that the names are not consistent. That took me quite a bit, hope someone else can find it useful.

Jan