Skip to content

Commit

Permalink
Add Spring Security REST filters and test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
cavemansspa committed Mar 28, 2016
1 parent c8adfe4 commit 1e18603
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [
[pattern: '/**/js/**', access: ['permitAll']],
[pattern: '/**/css/**', access: ['permitAll']],
[pattern: '/**/images/**', access: ['permitAll']],
[pattern: '/**/favicon.ico', access: ['permitAll']]
[pattern: '/**/favicon.ico', access: ['permitAll']],
[pattern: '/application/index', access: ['permitAll']]

]

grails.plugin.springsecurity.filterChain.chainMap = [
Expand All @@ -23,6 +25,8 @@ grails.plugin.springsecurity.filterChain.chainMap = [
[pattern: '/**/css/**', filters: 'none'],
[pattern: '/**/images/**', filters: 'none'],
[pattern: '/**/favicon.ico', filters: 'none'],
[pattern: '/**', filters: 'JOINED_FILTERS']
[pattern: '/application/testSecureJSON', filters: 'JOINED_FILTERS,-anonymousAuthenticationFilter,-exceptionTranslationFilter,-authenticationProcessingFilter,-securityContextPersistenceFilter,-rememberMeAuthenticationFilter' ],
[pattern: '/api/**', filters: 'JOINED_FILTERS,-anonymousAuthenticationFilter,-exceptionTranslationFilter,-authenticationProcessingFilter,-securityContextPersistenceFilter,-rememberMeAuthenticationFilter' ],
[pattern: '/**', filters: 'JOINED_FILTERS,-restTokenValidationFilter,-restExceptionTranslationFilter']
]

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package testappsecurityrest

import grails.converters.JSON
import grails.core.GrailsApplication
import grails.util.Environment
import grails.plugins.*
Expand All @@ -12,4 +13,10 @@ class ApplicationController implements PluginManagerAware {
def index() {
[grailsApplication: grailsApplication, pluginManager: pluginManager]
}

def testSecureJSON() {
def ret = [hello: 'world secure']
println 'in testJSecureSON ' + params
render ret as JSON
}
}

0 comments on commit 1e18603

Please sign in to comment.