2010-04-12 79 views
1

我有一个使用Spring安全性和BlazeDS的应用程序。 Flex 3.2用于客户端应用程序。通常,客户端应用程序使用RemoteObjects进行服务调用。Spring Security问题:控制器,匿名请求

但是,在某些情况下,客户端应用程序正在向URL发送请求。我们使用带注释的控制器进行URL映射。这里就是 “访问被拒绝” 的例外出现:

2010-04-12 11:43:23486 [qtp5138683-16]错误fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor - 意外的RuntimeException:访问被拒绝 org.springframework.security.access.AccessDeniedException:访问被拒绝 位于org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:71) at org.springframework.security.access.intercept.AbstractSecurityInterceptor。 beforeInvocation(AbstractSecurityInterceptor.java:203) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) at org.springfr amework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor.invoke(ServiceExceptionInterceptor.java:15) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( ReflectiveMethodInvocation.java:172) 在org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) 在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 的组织。 springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springfram ework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ... ...

回答

1

最好的方式来得到一些洞察到正在发生的事情是杀青记录了DEBUG和然后在发生违规请求时查看日志。

我的猜测是您的SpringSecurity配置将错误的访问规则应用于请求。如果您发布请求URL和访问控制配置,我们可能会弄清楚到底发生了什么。但我最初的怀疑将是:

  • 你在错误的顺序<intercept-url>元素,或
  • 您使用method属性在你的一些<intercept-url>元素,并没有得到你的头周围的( IMO违反直觉)的后果。