JWT Authentication in Symfony with Firebase/jwt

Опубликовано: 22 Март 2026
на канале: Mikhail Bukachuk
803
26

Open Telegram channel - https://t.me/PHPnoob
PHP Help Chat - https://t.me/php_noob

In this video, we'll implement JWT token authentication without using the LexikJWTAuthenticationBundle bundle. For encoding and decoding JWT, we'll use the firebase/jwt package and integrate it with Symfony. We'll also learn how to create your own authentication class. We'll also learn a little about troubleshooting issues with Symfony.

00:00 What we'll do in this video lesson
00:35 Installing the firebase/jwt package
00:50 Configuring security.yml for JSON login
01:10 Creating an endpoint in Postman
02:40 Understanding how to use firebase/jwt
03:10 Modifying the authentication controller to generate a JWT token
05:10 Closing the /api/blog endpoint with authentication in security.yml
06:00 Writing our own authentication class and configuring security.yml
06:50 Writing the ApiKeyAuthenticator authentication class
07:10 Configuring our own authentication class in the configuration file
07:30 Understanding how the supports method works
08:10 Writing the authenticate method in the authentication class
08:30 Logging in and getting a valid JWT token
09:00 Writing the method JWT verification in authenticate
11:00 Solving the Invalid Credentials issue.
11:40 Registering the missing role in the database
12:10 Messing around in the framework code to fix authorization
14:00 Finding the cause and fixing authorization, setting the property in security.yml
15:30 Handling Firebase/JWT exceptions
16:00 Generating new private and public keys for JWT signing
17:10 Exporting the key files to the framework settings
21:40 Finalizing what we've implemented

#programming #symfony #php #jwt