на проекте grails 2.4.3 Я использую плагин Spring Security Core (2.0RC4) и другой плагин вызова функции Flipping.Grails spring security запрещает доступ к другому плагину
Весь мой контроллер правильно защищен и аутентификация работает без проблем.
Плагин «Feature flipping» раскрывает URI /admin/feature
, который позволяет пользователю переключаться через сеть.
Я попытался настроить статические правила, чтобы разрешить только пользователям ROLE_ADMIN
получить доступ к этому ресурсу, но я все еще получаю ошибки «Доступ запрещен».
Любые идеи?
Мои staticRules:
'/admin/**': ['ROLE_ADMIN']
SpringSecurity журнала отладки:
2014-10-28 17:15:47,805 [http-bio-8080-exec-4] DEBUG matcher.AntPathRequestMatcher - Request '/admin/features' matched by universal pattern '/**'
2014-10-28 17:15:47,806 [http-bio-8080-exec-4] DEBUG web.FilterChainProxy - /admin/features at 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 a valid SecurityContext from SPRING_SECURITY_CONTEXT: '[email protected]16e65: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken[email protected]: Principal: [REDACTED][email protected]: Username: pygillier; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]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 at 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 at 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 at 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 at 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 at 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 at 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 at 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_]
вы пробовали включения отладки Spring Security? Я не могу подчеркнуть, насколько это полезно в поиске ошибок конфигурации и простых проблем. – rmlan
Включено отладка, до сих пор нет подсказок о том, что происходит (см. Вопрос для журналов) –
Ну, мы можем видеть из журнала, который вы опубликовали, что только атрибуты, возвращаемые для этого URL, являются '_DENY_'. Каков ваш параметр конфигурации для 'securityConfigType'? Если у вас их нет, плагин по умолчанию будет аннотировать, а не статическую карту правил. Вам нужно будет указать, что вы хотите использовать карту. – rmlan