1.2 KiB
1.2 KiB
Quickstart: 063 — Entra Sign-in
1. Environment Setup
Add the following to your .env file. These are required for the Microsoft Socialite provider.
MICROSOFT_CLIENT_ID=your-entra-app-client-id
MICROSOFT_CLIENT_SECRET=your-entra-app-client-secret
MICROSOFT_REDIRECT_URI="${APP_URL}/auth/entra/callback"
2. Install Dependencies
Ensure Laravel Socialite is installed:
sail composer require laravel/socialite
3. Configuration
Add the Microsoft provider configuration to config/services.php:
'microsoft' => [
'client_id' => env('MICROSOFT_CLIENT_ID'),
'client_secret' => env('MICROSOFT_CLIENT_SECRET'),
'redirect' => env('MICROSOFT_REDIRECT_URI'),
'tenant' => 'common', // Or your specific tenant ID
],
4. Run Migrations
The required columns (entra_tenant_id, entra_object_id) and the unique index should already exist from previous migrations. If not, a migration will be created.
sail artisan migrate
5. Usage
- Navigate to
/admin/login. - Click "Sign in with Microsoft".
- Complete the sign-in flow on the Microsoft page.
- You will be redirected back to the application and routed according to your tenant memberships.