
Security Advanced
Custom authenticators, voters, security expressions, CSRF protection, XSS prevention, rate limiting, production hardening, JWT/OAuth2 misconfigurations
1Which interface must a custom authenticator implement in Symfony 6+?
Which interface must a custom authenticator implement in Symfony 6+?
Jawaban
In Symfony 6+, custom authenticators must implement AuthenticatorInterface from the Security HTTP component. This interface defines the methods supports(), authenticate(), onAuthenticationSuccess(), onAuthenticationFailure() and optionally createToken(). It replaces the old Guard system that was used in Symfony 4/5.
2What is the role of the supports() method in a custom authenticator?
What is the role of the supports() method in a custom authenticator?
Jawaban
The supports() method determines if the authenticator should handle the current request. It receives the Request and returns a boolean. If true, the authenticate() method followed by onAuthenticationSuccess() or onAuthenticationFailure() will be called. This allows having multiple active authenticators on the same firewall, each handling a specific authentication type.
3What should the authenticate() method of a custom authenticator return on success?
What should the authenticate() method of a custom authenticator return on success?
Jawaban
The authenticate() method must return a Passport object containing a UserBadge (user identifier) and credentials badges. The Passport can also contain additional badges like CsrfTokenBadge or RememberMeBadge. Symfony then uses this Passport to create the authentication token and load the user via the UserProvider.
How to define a custom Voter to control access to a specific resource?
Which AccessDecisionManager strategy is recommended for applications requiring strict security?
+19 pertanyaan wawancara
Topik wawancara Symfony lainnya
Modern PHP (8.1+)
Symfony Basics
Routing & Controllers
Twig & Templates
Doctrine ORM Basics
Symfony Forms
Data Validation
Dependency Injection & Services
Security & Authentication
Doctrine Advanced
API Platform
Serializer Component
Events & Event Subscribers
Console & Commands
Messenger Component
HTTP Client
Cache & Performance
Workflow Component
Testing Symfony
Mailer Component
Translations & i18n
EasyAdmin Bundle
Symfony Architecture
Performance & Optimization
Custom Bundles
Microservices with Symfony
Real-time & WebSockets
Deployment & DevOps
Kuasai Symfony untuk wawancara berikutnya
Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.
Mulai gratis