开发者

Grails with SpringSecurity, local users and LDAP

开发者 https://www.devze.com 2022-12-18 21:34 出处:网络
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.

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

精彩评论

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