2017-06-13 18 views
0

Spring Security 4.2.3.RELEASEにアップグレードしましたが、今はログインできません。具体的には、私がログインしたときに、これらのパラメータにSpring Security 4にアップグレードしましたが、ログインできません。

OWASP_CSRFTOKEN ZLCK-J3VV-OJTK-8GZW-H68V-C8N6-CE6G-U6AQ 
j_password aaa 
j_username mouser 

を提出し、私はあなたはそれがある上からはっきりと見ることができ、エラー

Could not verify the provided CSRF token because your session was not found. 

を取得します。以下は私のSpringのセキュリティ設定です。これを動作させるためにチェックする必要があるものは何ですか?

<beans:bean id="mycoUsernamePasswordUrlAuthenticationFilter" 
    class="org.collegeboard.myco.core.security.mycoUsernamePasswordUrlAuthenticationFilter"> 
    <beans:property name="filterProcessesUrl" value="/j_spring_security_check" /> 
    <beans:property name="authenticationManager" ref="authenticationManager" /> 
    <beans:property name="authenticationFailureHandler"> 
     <beans:bean 
      class="org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler"> 
      <beans:property name="defaultFailureUrl" value="/login/failure" /> 
      <beans:property name="exceptionMappings" ref="exceptionMappings" /> 
     </beans:bean> 
    </beans:property> 
    <beans:property name="authenticationSuccessHandler"> 
     <beans:bean 
      class="org.collegeboard.myco.security.mycoAuthenticationSuccessHandler"> 
      <beans:property name="defaultTargetUrl" value="/authenticate" /> 
      <beans:property name="sessionService" ref="sessionService" /> 
     </beans:bean> 
    </beans:property> 
</beans:bean> 

...  
<beans:bean id="loginUrlAuthenticationEntryPoint" 
    class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"> 
    <beans:constructor-arg name="loginFormUrl" value="/login" /> 
</beans:bean> 


<http name="defaultSecurity" security-context-repository-ref="mycoSecurityContextRepository" 
    auto-config="false" use-expressions="true" authentication-manager-ref="authenticationManager" 
    entry-point-ref="loginUrlAuthenticationEntryPoint"> 
    <!-- <access-denied-handler error-page="/denied"/> --> 
    <custom-filter position="FORM_LOGIN_FILTER" 
     ref="mycoUsernamePasswordUrlAuthenticationFilter" /> 
    <intercept-url pattern="/lti/launch" access="permitAll" /> 
    <intercept-url pattern="/login" access="permitAll" /> 
    <intercept-url pattern="/status" access="permitAll" /> 
    <intercept-url pattern="/termsOfUse" access="permitAll" /> 
    <intercept-url pattern="/privacyPolicy" access="permitAll" /> 
    <intercept-url pattern="/contactUs" access="permitAll" /> 
    <intercept-url pattern="/legal" access="permitAll" /> 
    <intercept-url pattern="/logout" access="permitAll" /> 
... 
    <intercept-url pattern="/dwrsetcookie" access="isFullyAuthenticated()" /> 
    <intercept-url pattern="/dwrpageid" access="permitAll" /> 
    <logout invalidate-session="true" logout-success-url="/logout" logout-url="/j_spring_security_logout" /> 
</http> 

<authentication-manager alias="authenticationManager" id="authenticationManager"> 
    <authentication-provider user-service-ref="sbdUserDetailsService"> 
     <password-encoder ref="passwordEncoder" /> 
    </authentication-provider> 
</authentication-manager> 

答えて

2

HTTPタグ

<csrf disabled="true"/> 
+0

に以下を追加することで、ログインJSPにCSRFの入力より

<input type="hidden" name="${_csrf.parameterName}"value="${_csrf.token}"/> 

またはCSRFを無効を追加しよううん、それが進むべき道だっ無効。私はすでに自分のCSRFのことを続けていました。 – Dave

関連する問題