リスト項目
基本認証ヘッダーを使用している場合は、context-security.xml ファイルで次の構成が機能します。
< http auto-config="true" use-expressions="true" pattern="/project/api/**">
< intercept-url pattern="/**" access="isFullyAuthenticated()" requires-channel="${security.requires.channel}" method="POST"/>
< custom-filter ref="basicAuthenticationFilter" position="PRE_AUTH_FILTER"/>
< /http>
< beans:bean id="basicAuthenticationFilter" class="org.springframework.security.web.authentication.www.BasicAuthenticationFilter">
< beans:property name="authenticationManager" ref="authenticationManager" />
< beans:property name="authenticationEntryPoint" ref="authenticationEntryPoint" />
< /beans:bean>
私は残りのサービスに同じアプローチを使用しましたが、ユーザー名とパスワードのエンコードに使用するスキームが何であれ、「承認」ヘッダー情報をデコードするためにフィルターで使用するのと同じスキームに注意する必要があります。「Authorization」ヘッダーのエンコードにカスタム スキームを使用している場合は、「BasicAuthenticationFilter」を拡張し、「Authorization」ヘッダーの適切なデコードを提供する必要があります。