私はdomen
だけで火token_authenticatorにアクセスし、それは大丈夫です、私は^/api
が、いずれにもメインのファイアウォール内のパターンを変更するとき、私はsymfonyのsecurity.ymlファイルsymfonyはパターンdoesntのマッチにファイアウォール
providers:
main:
entity: { class: AppBundle\Entity\User, property: apiKey }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
anonymous: ~
guard:
authenticators:
- app.token_authenticator
との奇妙な問題を抱えていますoff domen/api | domen/api/ | domen/apissdads
トリガーtoken_authenticator、私も pattern: ^/api$
で試してみましたが同じです。 ^/
でのみ動作します。私も
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
これはSymfony Profileからの画像ですが、私はpattern: ^/api
達成したいことは何ですか?メインのファイアウォールの 'pattern'でパスを変更すると' token_authenticator'が使用されますが、正規表現に準拠しているパスに対してのみ使用されます。それは正しい動作です。 '/ api'のパスが' token_authenticator'を使わないようにする必要があれば、そのために別のファイアウォールを作ることができます。 –
私は 'この'セキュリティなどのtoken_authenticator'使用しよう: プロバイダ: メイン: エンティティ:{クラス:AppBundle \エンティティ\ユーザー、プロパティ:APIKEY} ファイアウォール: DEV: パターン:^ /(_(プロファイラを| WDT)| CSS |画像| JS)/ セキュリティ:偽 メイン: パターン:^/API セキュリティ:真 が匿名:〜 ガード: 認証者: - app.token_authenticator'しかし、私はに行きます '/api' doesnt trigger 'token_authenticator'; ' – squareCircle