Symfony

Security & Authentication

Firewalls, providers, encoders, voters, authenticators, JWT, OAuth2, access control

26 pertanyaan wawancaraยท
Mid-Level
1

What is the main role of a firewall in Symfony's Security component?

Jawaban

A firewall in Symfony defines a security zone for a part of the application. It determines how users are authenticated (form, token, API key) and which URLs are protected. Each firewall can have its own authentication configuration and user provider.

2

What is a User Provider in Symfony Security?

Jawaban

A User Provider is responsible for loading user information from a data source (database, LDAP, external API). It implements the UserProviderInterface and provides methods to load a user by identifier or refresh user data from the session.

3

Which interface must a User class implement to be used with Symfony Security?

Jawaban

The User class must implement UserInterface which defines essential methods: getUserIdentifier() for the unique identifier, getRoles() for roles, and eraseCredentials() to erase sensitive data. PasswordAuthenticatedUserInterface is also required for password authentication.

4

How to define role-based access control in security.yaml?

5

What is the difference between authentication and authorization in Symfony Security?

+23 pertanyaan wawancara

Kuasai Symfony untuk wawancara berikutnya

Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.

Mulai gratis