【问题标题】:Spring Security Issue: Controller, Anonymous RequestsSpring Security 问题:控制器、匿名请求
【发布时间】:2011-02-06 21:26:00
【问题描述】:

我有一个使用 Spring 安全性和 BlazeDS 的应用程序。 Flex 3.2 用于客户端应用程序。通常客户端应用程序使用 RemoteObjects 进行服务调用。

但是,在某些情况下,客户端应用会向 URL 发送请求。我们使用带注释的控制器进行 URL 映射。这是“访问被拒绝”异常出现的地方:

2010-04-12 11:43:23,486 [qtp5138683-16] 错误 fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor - 意外的 RuntimeException:访问被拒绝 org.springframework.security.access.AccessDeniedException:访问被拒绝 在 org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:71) 在 org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:203) 在 org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在 fr.plasticomnium.gpoc.utils.ServiceExceptionInterceptor.invoke(ServiceExceptionInterceptor.java:15) 在 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) 在 org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ... ...

【问题讨论】:

    标签: java apache-flex spring spring-security


    【解决方案1】:

    了解正在发生的事情的最佳方法是启动调试记录,然后在发生违规请求时查看日志。

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

    • <intercept-url> 元素的顺序错误,或者
    • 您在某些 <intercept-url> 元素中使用了 method 属性,并且没有意识到(IMO 违反直觉的)后果。

    【讨论】:

      猜你喜欢
      • 2021-01-04
      • 2015-10-09
      • 1970-01-01
      • 2014-08-19
      • 2021-10-27
      • 2018-08-08
      • 2014-09-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多