Laravel API Google Sign In/Sign Up (OAuth 2) using Firebase
Автор: codewithtee
Загружено: 2025-09-09
Просмотров: 268
Описание:
In this video, I’ll show you how to implement Google Sign In / Sign Up in a Laravel API using Firebase, without using Socialite!
Unlike Laravel Socialite (which is mainly for web apps), this method works perfectly for APIs that need to authenticate users from mobile apps or separate frontend clients.
We’ll build a fresh Laravel project and a small frontend demo to test the flow. On the backend, we’ll use Laravel Sanctum for issuing tokens and kreait/laravel-firebase to validate Google tokens from the client.
What you’ll learn in this video:
Setting up a new Laravel project for API authentication
Installing & configuring Firebase in Laravel
Enabling Google Sign In in Firebase Console
Validating Google tokens in Laravel using kreait/laravel-firebase
Creating or retrieving users in the database
Generating API tokens using Laravel Sanctum
Building a simple frontend to test the login flow
🌐 Authentication Flow:
User clicks "Login with Google" on the frontend
Google returns an ID token
The token is sent to the Laravel API
Laravel verifies the token with Firebase
User is created or retrieved from the database
Laravel Sanctum issues an API token
The token is used for all authenticated requests
✅ This works great for:
Single Page Applications (React, Vue, Angular)
Mobile Apps (iOS, Android, Flutter, React Native)
Any frontend that talks to a Laravel backend
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: