[英]Spring Security not working after migrating from version 3 to 4
Recently I migrated from Spring Security 3 to version 4. Everything worked well before but now nothing works.最近我从 Spring Security 3 迁移到版本 4。之前一切正常,但现在没有任何效果。
Here is my spring-security.xml
:这是我的
spring-security.xml
:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.0.xsd">
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/home.MRCMPU" access="permitAll"/>
<intercept-url pattern="/loginFailure.MRCMPU" access="permitAll"/>
<intercept-url pattern="/*.MRCMPU" access="permitAll"/>
<intercept-url pattern="/con" access="permitAll"/>
<form-login
login-page="/home.MRCMPU"
login-processing-url="/login" authentication-success-handler-ref="AuthenticationSuccess"
authentication-failure-handler-ref="AuthenticationFailure" username-parameter="username" password-parameter="password" />
<logout logout-url="/logout.MRCMPU" success-handler-ref="Logout" invalidate-session="true" delete-cookies="true"/>
</http>
<authentication-manager>
<authentication-provider user-service-ref="Authentication"/>
</authentication-manager>
</beans:beans>
Can anyone find the conflict from this code?任何人都可以从这段代码中找到冲突吗?
You are missing many referrenced beans here.您在这里缺少许多引用的 bean。
user-service-ref="Authentication"
success-handler-ref="Logout"
authentication-success-handler-ref="AuthenticationSuccess"
authentication-failure-handler-ref="AuthenticationFailure"
For the above mentioned references,you should have beans otherwise,like对于上面提到的参考文献,否则你应该有豆子,比如
No bean named 'Logout' is defined
未定义名为“Logout”的 bean
Exception will be thrown.将抛出异常。
Add bean class like添加bean类,如
<bean id="Authentication"
class="class which you need to refer">
</bean>
finally i cleared it myself.最后我自己清除了它。 by disabling csrf using xml
通过使用 xml 禁用 csrf
<csrf disabled="true"/>
but how can i do it without disabling csrf token但是我怎么能在不禁用 csrf 令牌的情况下做到这一点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.