# 高度なセキュリティ (Symfony) > Custom authenticator、voter、security expression、CSRF 保護、XSS 防止、rate limiting、本番環境のハードニング、JWT/OAuth2 の設定ミス - 22 面接問題 - Senior - [面接問題: Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions.md) ## 1. Symfony 6 以降で custom authenticator が実装しなければならないインターフェースはどれですか? **回答** Symfony 6 以降では、custom authenticator は Security HTTP コンポーネントの AuthenticatorInterface を実装する必要があります。このインターフェースは supports()、authenticate()、onAuthenticationSuccess()、onAuthenticationFailure() の各メソッドと、オプションで createToken() を定義します。これは Symfony 4/5 で使われていた古い Guard システムを置き換えるものです。 ## 2. custom authenticator における supports() メソッドの役割は何ですか? **回答** supports() メソッドは、その authenticator が現在のリクエストを処理すべきかどうかを判断します。Request を受け取り、ブール値を返します。true の場合、authenticate() メソッドが呼び出され、続いて onAuthenticationSuccess() または onAuthenticationFailure() が呼び出されます。これにより、同じ firewall 上で複数の authenticator を有効にし、それぞれが特定の認証タイプを処理できるようになります。 ## 3. custom authenticator の authenticate() メソッドは成功時に何を返すべきですか? **回答** authenticate() メソッドは、UserBadge(ユーザー識別子)と credentials badge を含む Passport オブジェクトを返さなければなりません。Passport には CsrfTokenBadge や RememberMeBadge などの追加の badge を含めることもできます。Symfony はこの Passport を使って認証 token を作成し、UserProvider を介してユーザーを読み込みます。 ## さらに19問利用可能 - 特定のリソースへのアクセスを制御するためのカスタム Voter はどのように定義しますか? - 厳格なセキュリティを必要とするアプリケーションには、どの AccessDecisionManager 戦略が推奨されますか? 無料で登録: https://sharpskill.dev/ja/login ## その他のSymfony面接トピック - [モダンPHP (8.1+)](https://sharpskill.dev/ja/technologies/symfony/interview-questions/php-modern-features.md): 20問, Junior - [Symfony の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/symfony-basics.md): 25問, Junior - [Routing & Controllers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/routing-controllers.md): 20問, Junior - [Twig & Templates](https://sharpskill.dev/ja/technologies/symfony/interview-questions/twig-templates.md): 20問, Junior - [Doctrine ORM の基礎](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-orm-basics.md): 25問, Junior - [Symfony フォーム](https://sharpskill.dev/ja/technologies/symfony/interview-questions/forms.md): 22問, Junior - [データバリデーション](https://sharpskill.dev/ja/technologies/symfony/interview-questions/validation.md): 18問, Junior - [Dependency Injection & Services](https://sharpskill.dev/ja/technologies/symfony/interview-questions/dependency-injection.md): 24問, Mid-Level - [Security & Authentication](https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-authentication.md): 26問, Mid-Level - [Doctrine 上級](https://sharpskill.dev/ja/technologies/symfony/interview-questions/doctrine-advanced.md): 24問, Mid-Level - [API Platform](https://sharpskill.dev/ja/technologies/symfony/interview-questions/api-platform.md): 22問, Mid-Level - [Serializer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/serializer.md): 20問, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/ja/technologies/symfony/interview-questions/events-subscribers.md): 20問, Mid-Level - [Console & Commands](https://sharpskill.dev/ja/technologies/symfony/interview-questions/console-commands.md): 18問, Mid-Level - [Messenger Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/messenger.md): 22問, Mid-Level - [HTTP Client](https://sharpskill.dev/ja/technologies/symfony/interview-questions/http-client.md): 18問, Mid-Level - [キャッシュとパフォーマンス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/cache.md): 20問, Mid-Level - [Workflow Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/workflow.md): 18問, Mid-Level - [Testing Symfony](https://sharpskill.dev/ja/technologies/symfony/interview-questions/testing.md): 22問, Mid-Level - [Mailer Component](https://sharpskill.dev/ja/technologies/symfony/interview-questions/mailer.md): 16問, Mid-Level - [翻訳と i18n](https://sharpskill.dev/ja/technologies/symfony/interview-questions/translations.md): 16問, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/ja/technologies/symfony/interview-questions/easyadmin.md): 18問, Mid-Level - [Symfony アーキテクチャ](https://sharpskill.dev/ja/technologies/symfony/interview-questions/architecture-patterns.md): 24問, Senior - [パフォーマンスと最適化](https://sharpskill.dev/ja/technologies/symfony/interview-questions/performance-optimization.md): 22問, Senior - [カスタムバンドル](https://sharpskill.dev/ja/technologies/symfony/interview-questions/custom-bundles.md): 20問, Senior - [Symfony によるマイクロサービス](https://sharpskill.dev/ja/technologies/symfony/interview-questions/microservices.md): 22問, Senior - [Real-time & WebSockets](https://sharpskill.dev/ja/technologies/symfony/interview-questions/real-time.md): 18問, Senior - [Deployment & DevOps](https://sharpskill.dev/ja/technologies/symfony/interview-questions/deployment-devops.md): 20問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/symfony/interview-questions/security-advanced