Google OAuth, PHP-Symfony, API-Platform, JWT
Dec 28, 2023
Symfony application using Google OAuth for authentication. When a user signs in through Google, our system will check if the user already exists in our database. If not, it will create a new user account. Once authenticated, either as a new or existing user, our application will generate a JSON Web Token (JWT). Built on the API Platform.
I have explained below which commands we need. If you want a detailed explanation, my Free Udemy course.
Creating Symfony Applications
symfony new my_project_directory
The Symfony MakerBundle
composer require --dev symfony/maker-bundle
API Platform
composer require api
doctrine/annotations
composer require doctrine/annotations
LexikJWTAuthenticationBundle
composer require "lexik/jwt-authentication-bundle"
Google Provider for OAuth 2.0 Client
composer require league/oauth2-google