Grails spring security denying access to other plugin -
Grails spring security denying access to other plugin -
on grails 2.4.3 project i'm using spring security core plugin (2.0rc4) , plugin phone call feature flipping.
all controller correctly secured , authentication working without problems.
the "feature flipping" plugin expose /admin/feature
uri allows user switch through web.
i tried configure static rules permit role_admin
users access resource, i'm still getting "access denied" errors.
any ideas ?
my staticrules:
'/admin/**': ['role_admin']
springsecurity debug log:
2014-10-28 17:15:47,805 [http-bio-8080-exec-4] debug matcher.antpathrequestmatcher - request '/admin/features' matched universal pattern '/**' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 1 of 8 in additional filter chain; firing filter: 'securitycontextpersistencefilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug context.httpsessionsecuritycontextrepository - obtained valid securitycontext spring_security_context: 'org.springframework.security.core.context.securitycontextimpl@2116e65: authentication: org.springframework.security.authentication.usernamepasswordauthenticationtoken@2116e65: principal: [redacted].security.userdetails@f9520f8b: username: pygillier; password: [protected]; enabled: true; accountnonexpired: true; credentialsnonexpired: true; accountnonlocked: true; granted authorities: role_admin; credentials: [protected]; authenticated: true; details: org.springframework.security.web.authentication.webauthenticationdetails@255f8: remoteipaddress: 127.0.0.1; sessionid: 7ff242941b7f95fd17e97d8611b3a5cf; granted authorities: role_admin, role_user' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 2 of 8 in additional filter chain; firing filter: 'mutablelogoutfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 3 of 8 in additional filter chain; firing filter: 'requestholderauthenticationfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 4 of 8 in additional filter chain; firing filter: 'securitycontextholderawarerequestfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 5 of 8 in additional filter chain; firing filter: 'grailsremembermeauthenticationfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 6 of 8 in additional filter chain; firing filter: 'grailsanonymousauthenticationfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 7 of 8 in additional filter chain; firing filter: 'exceptiontranslationfilter' 2014-10-28 17:15:47,806 [http-bio-8080-exec-4] debug web.filterchainproxy - /admin/features @ position 8 of 8 in additional filter chain; firing filter: 'filtersecurityinterceptor' 2014-10-28 17:15:47,807 [http-bio-8080-exec-4] debug intercept.filtersecurityinterceptor - secure object: filterinvocation: url: /admin/features; attributes: [_deny_]
i'm going give shot based on info i've gotten already. if not specifying securityconfigtype
, grails spring security plugin default using annotations on controller classes. if case (or explicitly using annotations because want to), have couple of options:
grails.plugin.springsecurity.rejectifnorule
false. not recommended potentially leaves other urls not explicitly secured open all. might ok development, though. if assumptions correct, using wrong static rules configuration. if using annotations, static rules map must defined configuration item grails.plugin.springsecurity.controllerannotations.staticrules
as such, configuration should this:
grails.plugin.springsecurity.controllerannotations.staticrules = [ '/admin/**': ['role_admin'] ]
for reference, line of code gave me hint going on here. tells me spring security plugin unable find 'role_admin'
attribute had defined, , rejectifnorule
set true (which default).
grails spring-security grails-plugin
Comments
Post a Comment