# Zaawansowane bezpieczeństwo (Symfony) > Custom authenticators, voters, security expressions, ochrona CSRF, zapobieganie XSS, rate limiting, hardening produkcyjny, błędne konfiguracje JWT/OAuth2 - 22 pytań z rozmów - Senior - [Pytania z rozmów: Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne.md) ## 1. Który interfejs musi implementować custom authenticator w Symfony 6+? **Odpowiedź** W Symfony 6+ custom authenticatory muszą implementować AuthenticatorInterface z komponentu Security HTTP. Ten interfejs definiuje metody supports(), authenticate(), onAuthenticationSuccess(), onAuthenticationFailure() oraz opcjonalnie createToken(). Zastępuje stary system Guard, który był używany w Symfony 4/5. ## 2. Jaką rolę pełni metoda supports() w custom authenticatorze? **Odpowiedź** Metoda supports() określa, czy authenticator powinien obsłużyć bieżące żądanie. Otrzymuje Request i zwraca wartość logiczną. Jeśli true, wywoływana jest metoda authenticate(), a następnie onAuthenticationSuccess() lub onAuthenticationFailure(). Pozwala to mieć wiele aktywnych authenticatorów na tym samym firewallu, z których każdy obsługuje określony typ uwierzytelniania. ## 3. Co metoda authenticate() custom authenticatora powinna zwrócić w przypadku powodzenia? **Odpowiedź** Metoda authenticate() musi zwrócić obiekt Passport zawierający UserBadge (identyfikator użytkownika) oraz credentials badge. Passport może również zawierać dodatkowe badge, takie jak CsrfTokenBadge lub RememberMeBadge. Następnie Symfony używa tego Passport do utworzenia tokenu uwierzytelniania i załadowania użytkownika za pośrednictwem UserProvider. ## Jeszcze 19 dostępnych pytań - Jak zdefiniować niestandardowy Voter, aby kontrolować dostęp do określonego zasobu? - Która strategia AccessDecisionManager jest zalecana dla aplikacji wymagających ścisłego bezpieczeństwa? Zarejestruj się za darmo: https://sharpskill.dev/pl/login ## Inne tematy rekrutacyjne Symfony - [Nowoczesny PHP (8.1+)](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/php-modern-features.md): 20 pytań, Junior - [Podstawy Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/symfony-basics.md): 25 pytań, Junior - [Routing & Controllers](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/routing-controllers.md): 20 pytań, Junior - [Twig & Templates](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/twig-templates.md): 20 pytań, Junior - [Podstawy Doctrine ORM](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/doctrine-orm-basics.md): 25 pytań, Junior - [Formularze Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/forms.md): 22 pytań, Junior - [Walidacja danych](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/validation.md): 18 pytań, Junior - [Dependency Injection & Services](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/dependency-injection.md): 24 pytań, Mid-Level - [Security & Authentication](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/security-authentication.md): 26 pytań, Mid-Level - [Zaawansowany Doctrine](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/doctrine-advanced.md): 24 pytań, Mid-Level - [API Platform](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/api-platform.md): 22 pytań, Mid-Level - [Serializer Component](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/serializer.md): 20 pytań, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/events-subscribers.md): 20 pytań, Mid-Level - [Console & Commands](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/console-commands.md): 18 pytań, Mid-Level - [Messenger Component](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/messenger.md): 22 pytań, Mid-Level - [HTTP Client](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/http-client.md): 18 pytań, Mid-Level - [Cache i wydajność](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/cache.md): 20 pytań, Mid-Level - [Workflow Component](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/workflow.md): 18 pytań, Mid-Level - [Testing Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/testing.md): 22 pytań, Mid-Level - [Mailer Component](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/mailer.md): 16 pytań, Mid-Level - [Tłumaczenia i i18n](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/translations.md): 16 pytań, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/easyadmin.md): 18 pytań, Mid-Level - [Architektura Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/architecture-patterns.md): 24 pytań, Senior - [Wydajność i optymalizacja](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/performance-optimization.md): 22 pytań, Senior - [Niestandardowe bundle](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/custom-bundles.md): 20 pytań, Senior - [Microservices z Symfony](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/microservices.md): 22 pytań, Senior - [Real-time & WebSockets](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/real-time.md): 18 pytań, Senior - [Deployment & DevOps](https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/deployment-devops.md): 20 pytań, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pl/technologies/symfony/pytania-rekrutacyjne/security-advanced