-
Notifications
You must be signed in to change notification settings - Fork 0
/
Login.php
30 lines (23 loc) · 771 Bytes
/
Login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace App\Http\Controllers\Rp2;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class Login
{
public function __invoke(): RedirectResponse
{
$authorizeUri = 'http://127.0.0.1:4444/oauth2/auth';
$query = Arr::query([
'client_id' => 'rp2',
'redirect_uri' => 'http://127.0.0.1:8000/rp2/callback',
'scope' => 'openid',
'response_type' => 'code',
'state' => '1a2b3c4d',
]);
$authenticationRequest = $authorizeUri . '?' . $query;
Log::info('Authentication Request: ' . $authenticationRequest);
return Redirect::away($authenticationRequest);
}
}