Support for Basic Auth and Form-Based Authenticaion in Grails

I need to support basic Auth and Formbased authentication for an application using grails 1.3.6. Can this be done with Spring Security? Right now I have formal authentication working for the application, what do I need to do more to support both? Or is it impossible?

+6
source share
2 answers

Yes, Spring Security can support basic auth along with auth. To allow basic authentication 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' ] 
+2
source

Edit

 grails.plugins.** 

to

 grails.plugin.** 

without "s" on grails 2.3.9 .

-2
source

Source: https://habr.com/ru/post/920364/


All Articles