简体   繁体   English

Spring 与 BlazeDS 全局方法安全性不起作用

[英]Spring with BlazeDS Global Method Security not working

I am using BlazeDS and Spring Security and have set up my application using a Spring Security filter chain and Dispatcher Servlet in my web.xml and in my application-context.xml I have set up the following... I am using BlazeDS and Spring Security and have set up my application using a Spring Security filter chain and Dispatcher Servlet in my web.xml and in my application-context.xml I have set up the following...

<s:http 
    auto-config="true" 
    access-decision-manager-ref="accessDecisionManager"/>

<s:authentication-manager>
    <s:authentication-provider
        user-service-ref="userService"/>
</s:authentication-manager>

<f:message-broker>
    <f:secured/>
</f:message-broker>

<s:global-method-security 
    access-decision-manager-ref="accessDecisionManager">
    <s:protect-pointcut 
        expression="execution(* com.my.app.Server.*(..))" 
        access="ROLE_USER"/>
</s:global-method-security>

This generally works.这通常有效。 The Spring message broker correctly allows me to access my java Server class and the 'secured' tag works and allows me to log into the channel set using my custom authentication manager (via userService). Spring 消息代理允许我正确访问我的 java 服务器 class 并且“安全”标签有效,并允许我使用我的自定义身份验证管理器登录到通道集(通过 userService)。 I can call remote methods on the Server class no problem.我可以在服务器 class 上调用远程方法没有问题。

However, I cannot get the global method security to work at all.但是,我根本无法让全局方法安全性工作。 I cannot get Spring to invoke my accessDecisionManager, or even to deny access to methods on the Server class, no matter which access role I use.无论我使用哪种访问角色,我都无法让 Spring 调用我的 accessDecisionManager,甚至拒绝访问服务器 class 上的方法。 Does anybody know how I can get this to work?有人知道我怎样才能让它工作吗?

Incidentally, my Server class is not a Spring bean or anything like that, it is just a standard Java class as would be used in standard Flex remoting. Incidentally, my Server class is not a Spring bean or anything like that, it is just a standard Java class as would be used in standard Flex remoting. Would this make a difference?这会有所作为吗?

I'm using Spring Security 3 and Flex 4.5我正在使用 Spring 安全 3 和 Flex 4.5

Point cuts and aspects only works for Spring beans, if it is plain java object spring cannot intercept any method calls as it is not proxied. Point cuts and aspects only works for Spring beans, if it is plain java object spring cannot intercept any method calls as it is not proxied. Please create a spring bean for your server class and it should be working fine.请为您的服务器 class 创建一个 spring bean,它应该可以正常工作。

Once you created the spring bean you can expose the bean through blaze DS using flex:remoting-destination创建 spring bean 后,您可以使用 flex:remoting-destination 通过 blaze DS 公开 bean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring全局方法安全性和Aspectj - Spring Global Method Security And Aspectj Spring Security + Flex + BlazeDS登录问题 - Spring Security + Flex + BlazeDS Login Issue 测试期间的 Spring MockMVC、Spring 安全性和全局方法安全性 - Spring MockMVC, Spring security and Global Method Security during test Spring Security 3.2-配置全局方法安全性以使用角色层次结构 - Spring Security 3.2 - configuring global method security to use role hierarchy 用于Spring Security和/或Spring BlazeDS集成的会话管理(和终止)的集中式系统 - Centralized system for session management (and killing) for Spring Security and/or Spring BlazeDS Integration 在Spring Security中将XML配置转换为Java配置以实现全局方法安全 - Converting XML configuration to java configuration in spring security for global method security 春季安全全球授权 - global authorization in spring security Spring:通过java配置在Controller层中启用全局方法安全性 - Spring: Enable global method security in Controller layer by java config Spring Security,Method Security annotation(@Secured)无效(java config) - Spring Security, Method Security annotation (@Secured ) is not working (java config) 无法在Spring Security中使用@Secured Method Security批注 - Can not get the @Secured Method Security annotations working in Spring Security
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM