I need to support Basic Auth and Formbased authentication for a application using grails 1.3.6. Is it possible to do it using Spring Security ? Right now I do have form based authentication working for the application, what do I need to do more so that it support both ? Or is it not possible ?
Yes, Spring Security can support basic auth along with form-based auth. To allow basic auth for specific URLs or patterns you can add the following configuration:
grails.plugins.springsecurity.useBasicAuth = true
grails.plugins.springsecurity.basic.realmName = "My App Name"
grails.plugins.springsecurity.filterChain.chainMap = [
'/someController/someAction': 'JOINED_FILTERS,-exceptionTranslationFilter',
'/**': 'JOINED_FILTERS,-basicAuthenticationFilter,-basicExceptionTranslationFilter'
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With