0

次のように HTTPS でサイトにアクセスするたびに、フィルターが適用されない理由を理解するのに問題がありますhttps://localhost:8443/initiator。したがって、認証されていないユーザーのログイン ページに正しくリダイレ​​クトされません。を使用してアクセスした場合、正常にhttp://localhost:8080/initiator機能しています。

Web アプリケーションに非常に単純な Spring セキュリティ構成を使用しています。以下に示すように、すべてのリンクを SSL にしたいと考えています。

<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-3.1.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  <http auto-config="false"  >
   <intercept-url pattern="/**" requires-channel="https"/>
   <intercept-url pattern="/initiator*" access="ROLE_USER" />
   <!-- Other configuration here like the logout, login, etc-->
  </http>
</beans>

Spring Security バージョン 3.1.3.RELEASE を使用しています。http の場合はすべて正常に動作することに注意してください。httpsにすると動かなくなりました。

どうもありがとうございました。

4

1 に答える 1

0

ルールを交換してみましたか?優先順位の関係で、行くときhttps://localhost:8443/initiatorは最初のルールがとられていると思います。つまり、この方法で試してください:

<intercept-url pattern="/initiator*" access="ROLE_USER" />
<intercept-url pattern="/**" requires-channel="https"/>
于 2013-06-19T10:21:30.413 に答える