Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

supporting Basic Auth and Form based Authenticaion in Grails

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 ?

like image 729
allthenutsandbolts Avatar asked Jul 12 '12 19:07

allthenutsandbolts


1 Answers

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'
]
like image 153
doelleri Avatar answered Nov 01 '22 20:11

doelleri