1

春のセキュリティを使用してユーザーにログインしているときに問題に直面しています。私は春のセキュリティ 3.1 を使用しています。パターン「/brand/**」にアクセスするユーザーに対して、別の認証マネージャーを使用したいと考えています。そこで、"http" タグに pattern と authentication-manager-ref を指定しました。カスタム ユーザー詳細サービスを作成しました。

以下は私の spring-security.xml 構成です。pattern="/brand/**" ログイン フォームの送信を削除すると、カスタム ユーザー詳細サービスが使用されます。しかし、"http" タグに pattern="/brand/**" を入れたままにすると、うまくいきません。

   <http auto-config="true" pattern="/brand/**" use-expressions="true" authentication-manager-ref="brandAuthenticationManager">
    <intercept-url pattern="/brandLogin" access="permitAll" />
    <intercept-url pattern="/brand/activity/**" access="hasRole('BRAND_USER')" />
    <form-login login-page="/brandLogin" authentication-failure-url="/brand/login/failure"
        default-target-url="/" />

    <access-denied-handler error-page="/brand/denied" />

    <logout invalidate-session="true" logout-success-url="/brand/logout/success"
        logout-url="/brand/logout" />
</http>


   <authentication-manager alias="brandAuthenticationManager">
    <authentication-provider user-service-ref="customBrandUserDetailsService">
        <password-encoder ref="passEncoder">
            <salt-source user-property="salt" />
        </password-encoder>

    </authentication-provider>
</authentication-manager>

<beans:bean id="customBrandUserDetailsService" class="com.myproj.service.CustomBrandUserDetailsService"></beans:bean>

なぜこのようなことが起こっているのかについてのアイデアはありますか? 助けてください ...

4

0 に答える 0