Apache flex [Spring Flex][ACEGI]错误或没有安全性
正如我在问题的标题中所说,我没有成功地配置Spring安全性。。。 我关注了詹姆斯·沃德或杰特罗·科恩拉迪写的两篇文章,但我仍然没有 首先,我尝试在一个虚假的项目中实现所有这些,而且效果很好,而不是在真实的项目中尝试。关于Spring安全性,配置文件完全相同,但实际项目失败 我的配置 在web.xml中:Apache flex [Spring Flex][ACEGI]错误或没有安全性,apache-flex,security,spring,spring-security,Apache Flex,Security,Spring,Spring Security,正如我在问题的标题中所说,我没有成功地配置Spring安全性。。。 我关注了詹姆斯·沃德或杰特罗·科恩拉迪写的两篇文章,但我仍然没有 首先,我尝试在一个虚假的项目中实现所有这些,而且效果很好,而不是在真实的项目中尝试。关于Spring安全性,配置文件完全相同,但实际项目失败 我的配置 在web.xml中: <context-param> <param-name>contextConfigLocation</param-name> <par
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/applicationContext.xml</param-value>
</context-param>
...
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
<servlet>
<servlet-name>Spring MVC Servlet Dispatcher</servlet-name>
<display-name>Spring MVC Servlet Dispatcher</display-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/webApplicationContext.xml</param- value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
在applicationContext.xml中:
<security:global-method-security secured-annotations="enabled" jsr250-annotations="enabled" />
<security:http entry-point-ref="preAuthenticatedEntryPoint">
<security:anonymous enabled="false"/>
</security:http>
<bean id="preAuthenticatedEntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint"/>
<security:authentication-manager>
<security:authentication-provider>
<security:user-service>
<security:user name="arnaud" password="arnaud" authorities="ROLE_USER"/>
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
在webApplicationContext.xml ceci中:
<flex:message-broker>
<flex:secured />
</flex:message-broker>
在每个bean服务中:
<security:intercept-methods>
<security:protect method="*" access="ROLE_USER" />
</security:intercept-methods>
首先,我尝试用注解@SecuredROLE_USER替换最后一段代码,但没有成功,这就是为什么我使用了security:intercept方法和security:protect标记
在我的第一个假项目中,当我启动flex应用程序时,一个简单的datagrid检索产品列表,产品没有加载,我调度了一个FaultEvent,因此Spring安全性工作
在第二个项目(真正的项目)中,我在部署时出错,告诉我*或findAll在我尝试时不是有效的方法名
与
我不再有这个错误,我可以启动我的flex应用程序
但是当我启动它时,我的所有用户是的,在第二个应用程序中,我检索用户,而不是产品加载到datagrid中!这意味着安全根本不起作用
这快把我逼疯了 我希望在元素中看到一些元素。您使用的是哪个版本的spring/spring security?
<security:protect method="com.blablabla.UserService.findAll" access="ROLE_USER" />