2

ShibbolethBundle( https://github.com/rmoreas/ShibbolethBundle )作業を取得しようとしています。しかし、ログイン時に新しいユーザーを作成することに固執しました。userProviderが正しいクラスではないことがわかりました(ShibbolethUserProviderInterfaceここで実装するものhttps://github.com/rmoreas/ShibbolethBundle/blob/master/Security/ShibbolethAuthProvider.php#L109

私のカスタム プロバイダーは次のように定義されています。

namespace Meot\FormBundle\Entity;
...
class UserRepository extends EntityRepository implements ShibbolethUserProviderInterface {
...
}

Security.xml

....
security:
     providers:
         main_provider:
             entity: { class: Meot\FormBundle\Entity\User }

     firewalls:
         dev:
             pattern:  ^/(_(profiler|wdt)|css|images|js)/
             security: false
         secured_area:
             pattern:    ^/
             shibboleth: ~
             logout:
                 path: /logout
                 target: /
                 success_handler: security.logout.handler.shibboleth

このクックブック ( http://symfony.com/doc/current/cookbook/security/entity_provider.html ) の状態を見つけました

実装を完了するには、セキュリティ レイヤーの構成を変更して、Symfony に一般的な Doctrine エンティティ プロバイダーの代わりに新しいカスタム エンティティ プロバイダーを使用するように指示する必要があります。security.yml ファイルの security.providers.administrators.entity セクションのプロパティ フィールドを削除することで簡単に実現できます。

試してみましたが、うまくいきませんでした。ユーザー プロバイダーのクラスは引き続きSymfony\Bridge\Doctrine\Security\User\EntityUserProvider.

プロパティ フィールドを削除して、どうやって Symfony がカスタム ユーザー プロバイダーを見つけられるのでしょうか?

ありがとう。

4

1 に答える 1