entraid integration completa with docs

This commit is contained in:
2025-09-19 09:31:20 +02:00
parent baf3f6da32
commit 16e00f8573
18 changed files with 826 additions and 67 deletions
+24
View File
@@ -1,5 +1,7 @@
<?php
use Laravel\Socialite\Facades\Socialite;
/**
* Authentication
*/
@@ -196,3 +198,25 @@ Route::get('/userarea/upload-photos-mobile', [UploadPhotosMobileController::clas
Route::post('/userarea/upload-photos-mobile', [UploadPhotosMobileController::class, 'upload'])
->name('userarea.upload-photos-mobile.upload');
// Microsoft Auth Routes
Route::get('/auth/microsoft/login', function () {
return Socialite::driver('microsoft')->redirect();
})->name('auth.microsoft');
Route::get('/auth/microsoft/callback', function () {
try {
$user = Socialite::driver('microsoft')->user();
return response()->json([
'status' => 'SUCCESS',
'user_data' => [
'id' => $user->getId(),
'name' => $user->getName(),
'email' => $user->getEmail(),
'avatar' => $user->getAvatar(),
]
]);
} catch (Exception $e) {
return response()->json(['status' => 'ERROR', 'message' => $e->getMessage()]);
}
})->name('auth.microsoft.callback');