mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: add OIDC support
This commit is contained in:
parent
d6dd1c5f31
commit
65b9162ef3
12 changed files with 1256 additions and 644 deletions
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\OidcProvider;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use URL;
|
||||
use Laravel\Socialite\Facades\Socialite;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -23,5 +25,17 @@ class AppServiceProvider extends ServiceProvider
|
|||
if (app()->isProduction() && config('app.force_https')) {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
|
||||
// Register OIDC provider with Socialite
|
||||
Socialite::extend('oidc', function ($app) {
|
||||
$config = $app['config']['services.oidc'] ?? [];
|
||||
return new OidcProvider(
|
||||
$app['request'],
|
||||
$config['client_id'] ?? null,
|
||||
$config['client_secret'] ?? null,
|
||||
$config['redirect'] ?? null,
|
||||
$config['scopes'] ?? ['openid', 'profile', 'email']
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue