簡體   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...

<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>

這通常有效。 Spring 消息代理允許我正確訪問我的 java 服務器 class 並且“安全”標簽有效,並允許我使用我的自定義身份驗證管理器登錄到通道集(通過 userService)。 我可以在服務器 class 上調用遠程方法沒有問題。

但是,我根本無法讓全局方法安全性工作。 無論我使用哪種訪問角色,我都無法讓 Spring 調用我的 accessDecisionManager,甚至拒絕訪問服務器 class 上的方法。 有人知道我怎樣才能讓它工作嗎?

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. 這會有所作為嗎?

我正在使用 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. 請為您的服務器 class 創建一個 spring bean,它應該可以正常工作。

創建 spring bean 后,您可以使用 flex:remoting-destination 通過 blaze DS 公開 bean

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM