简体   繁体   中英

Securing access to plugin URL with spring security

I want to install JavaMelody grails plugin, although that is only possible if I can secure access to it. There are a lot of people having this problem, the only applicable solution I found was using interceptUrlMap but that does not work either. This is what I have in my Config.groovy

// Added by the Spring Security Core plugin:
grails.plugins.springsecurity.userLookup.userDomainClassName = 'com.auth.User'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'com.auth.UserRole'
grails.plugins.springsecurity.userLookup.usernamePropertyName='username'
grails.plugins.springsecurity.authority.className = 'com.auth.Role'
// grails.plugins.springsecurity.securityConfigType = "Annotation"

grails.plugin.springsecurity.securityConfigType = 'InterceptUrlMap'
ograils.plugin.springsecurity.interceptUrlMap  = [
    '/monitoring': ['ROLE_ADMIN','IS_AUTHENTICATED_FULLY']
]

The application is using annotation for security, although I disabled only to test if thats whats causing the problem, but without success.

What other options do I have for securing a URL? It has to be something that can be controlled from the application, and not any setting that is not contained in the grails application package.

It appears it is working if I use the following:

grails.plugins.springsecurity.controllerAnnotations.staticRules = [
 '/monitoring/**': ['ROLE_ADMIN']
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM