开发者

Grails with SpringSecurity, local users and LDAP

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜