2016-09-23 8 views
-1

最近、私はSpring Security 3からバージョン4に移行しました。ここでバージョン3からバージョン4への移行後にSpringセキュリティが機能しない

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

誰もがこのコードから競合を見つけることができますか?

+2

共有サーバー自体あなたを開始する一方で、フォームのアクションURLが –

+1

404エラーを取得しているかの例外私の答えで述べたように、設定が正しくない場合は例外が発生します – pjishnu

+1

に動作していない –

答えて

0

多くの参照先Beanがありません。上記の文献に言及するために

  • authentication-failure-handler-ref="AuthenticationFailure"
    1. user-service-ref="Authentication"
    2. success-handler-ref="Logout"
    3. authentication-success-handler-ref="AuthenticationSuccess"
    4. は、あなたが 'ログアウト' という名前の

      ませBeanのように、それ以外の場合は豆を持っている必要があります私定義済み

      例外がスローされます。

      <bean id="Authentication" 
          class="class which you need to refer"> 
      </bean> 
      
    -1

    は最終的に私はそれを自分自身をクリアよう

    は、Beanクラスを追加します。 CSRFトークン無効にせず、私はそれを行うことができますどのようにXML

    <csrf disabled="true"/> 
    

    を使用しますが、CSRF無効にすることによって

    関連する問題