我有從Bean_2調用方法的Bean_1。 Bean_1具有以下安全配置:Spring Security RunAsManagerImpl不起作用
<protect-pointcut expression="execution(* com.proficiency.cg.core.blc.Bean_1.*.*(..))" access="ROLE_Administrators,RUN_AS_InternalRole"/>
Bean_2 - 有以下安全配置:
<protect-pointcut expression="execution(* com.proficiency.cg.core.blc.Bean_2.*.*(..))" access="ROLE_InternalRole"/>
在另外的 - 我成立了RunAsManager:
<b:bean id="runAsManager"
class="org.springframework.security.access.intercept.RunAsManagerImpl">
<b:property name="key" value="prof_key"/>
</b:bean>
<b:bean id="runAsAuthenticationProvider"
class="org.springframework.security.access.intercept.RunAsImplAuthenticationProvider">
<b:property name="key" value="prof_key"/>
</b:bean>
<global-method-security secured-annotations="enabled" run-as-manager-ref="runAsManager" authentication-manager-ref="authenticationManager">
當我運行我的測試程序 - 我在訪問Bean_2時遇到安全異常。 結論:RunAsManager - 無法正常工作或環礁。