@@ -285,7 +285,7 @@ php artisan passport:client
285
285
If you would like to allow multiple redirect URIs for your client, you may specify them using a comma-delimited list when prompted for the URI by the ` passport:client ` command. Any URIs which contain commas should be URI encoded:
286
286
287
287
``` shell
288
- http ://example .com/callback,http ://examplefoo .com/callback
288
+ https ://third-party-app .com/callback,https ://example .com/oauth/redirect
289
289
```
290
290
291
291
<a name =" managing-third-party-clients " ></a >
@@ -303,7 +303,7 @@ $user = User::find($userId);
303
303
$client = app(ClientRepository::class)->createAuthorizationCodeGrantClient(
304
304
user: $user,
305
305
name: 'Example App',
306
- redirectUris: ['https://example .com/callback'],
306
+ redirectUris: ['https://third-party-app .com/callback'],
307
307
confidential: false,
308
308
enableDeviceFlow: true
309
309
);
@@ -331,14 +331,14 @@ Route::get('/redirect', function (Request $request) {
331
331
332
332
$query = http_build_query([
333
333
'client_id' => 'your-client-id',
334
- 'redirect_uri' => 'http ://third-party-app.com/callback',
334
+ 'redirect_uri' => 'https ://third-party-app.com/callback',
335
335
'response_type' => 'code',
336
336
'scope' => 'user:read orders:create',
337
337
'state' => $state,
338
338
// 'prompt' => '', // "none", "consent", or "login"
339
339
]);
340
340
341
- return redirect('http ://passport-app.test/oauth/authorize?'.$query);
341
+ return redirect('https ://passport-app.test/oauth/authorize?'.$query);
342
342
});
343
343
```
344
344
@@ -398,11 +398,11 @@ Route::get('/callback', function (Request $request) {
398
398
'Invalid state value.'
399
399
);
400
400
401
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
401
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
402
402
'grant_type' => 'authorization_code',
403
403
'client_id' => 'your-client-id',
404
404
'client_secret' => 'your-client-secret',
405
- 'redirect_uri' => 'http ://third-party-app.com/callback',
405
+ 'redirect_uri' => 'https ://third-party-app.com/callback',
406
406
'code' => $request->code,
407
407
]);
408
408
@@ -454,7 +454,7 @@ If your application issues short-lived access tokens, users will need to refresh
454
454
``` php
455
455
use Illuminate\Support\Facades\Http;
456
456
457
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
457
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
458
458
'grant_type' => 'refresh_token',
459
459
'refresh_token' => 'the-refresh-token',
460
460
'client_id' => 'your-client-id',
@@ -572,7 +572,7 @@ Route::get('/redirect', function (Request $request) {
572
572
573
573
$query = http_build_query([
574
574
'client_id' => 'your-client-id',
575
- 'redirect_uri' => 'http ://third-party-app.com/callback',
575
+ 'redirect_uri' => 'https ://third-party-app.com/callback',
576
576
'response_type' => 'code',
577
577
'scope' => 'user:read orders:create',
578
578
'state' => $state,
@@ -581,7 +581,7 @@ Route::get('/redirect', function (Request $request) {
581
581
// 'prompt' => '', // "none", "consent", or "login"
582
582
]);
583
583
584
- return redirect('http ://passport-app.test/oauth/authorize?'.$query);
584
+ return redirect('https ://passport-app.test/oauth/authorize?'.$query);
585
585
});
586
586
```
587
587
@@ -606,10 +606,10 @@ Route::get('/callback', function (Request $request) {
606
606
InvalidArgumentException::class
607
607
);
608
608
609
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
609
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
610
610
'grant_type' => 'authorization_code',
611
611
'client_id' => 'your-client-id',
612
- 'redirect_uri' => 'http ://third-party-app.com/callback',
612
+ 'redirect_uri' => 'https ://third-party-app.com/callback',
613
613
'code_verifier' => $codeVerifier,
614
614
'code' => $request->code,
615
615
]);
@@ -677,7 +677,7 @@ Once a client has been created, developers may use their client ID to request a
677
677
``` php
678
678
use Illuminate\Support\Facades\Http;
679
679
680
- $response = Http::asForm()->post('http ://passport-app.test/oauth/device/code', [
680
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/device/code', [
681
681
'client_id' => 'your-client-id',
682
682
'scope' => 'user:read orders:create',
683
683
]);
@@ -709,7 +709,7 @@ $interval = 5;
709
709
do {
710
710
Sleep::for($interval)->seconds();
711
711
712
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
712
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
713
713
'grant_type' => 'urn:ietf:params:oauth:grant-type:device_code',
714
714
'client_id' => 'your-client-id',
715
715
'client_secret' => 'your-client-secret', // required for confidential clients only
@@ -763,7 +763,7 @@ Once you have enabled the grant and have created a password grant client, you ma
763
763
``` php
764
764
use Illuminate\Support\Facades\Http;
765
765
766
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
766
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
767
767
'grant_type' => 'password',
768
768
'client_id' => 'your-client-id',
769
769
'client_secret' => 'your-client-secret', // required for confidential clients only
@@ -786,7 +786,7 @@ When using the password grant or client credentials grant, you may wish to autho
786
786
``` php
787
787
use Illuminate\Support\Facades\Http;
788
788
789
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
789
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
790
790
'grant_type' => 'password',
791
791
'client_id' => 'your-client-id',
792
792
'client_secret' => 'your-client-secret', // required for confidential clients only
@@ -892,14 +892,14 @@ Route::get('/redirect', function (Request $request) {
892
892
893
893
$query = http_build_query([
894
894
'client_id' => 'your-client-id',
895
- 'redirect_uri' => 'http ://third-party-app.com/callback',
895
+ 'redirect_uri' => 'https ://third-party-app.com/callback',
896
896
'response_type' => 'token',
897
897
'scope' => 'user:read orders:create',
898
898
'state' => $state,
899
899
// 'prompt' => '', // "none", "consent", or "login"
900
900
]);
901
901
902
- return redirect('http ://passport-app.test/oauth/authorize?'.$query);
902
+ return redirect('https ://passport-app.test/oauth/authorize?'.$query);
903
903
});
904
904
```
905
905
@@ -943,7 +943,7 @@ To retrieve a token using this grant type, make a request to the `oauth/token` e
943
943
``` php
944
944
use Illuminate\Support\Facades\Http;
945
945
946
- $response = Http::asForm()->post('http ://passport-app.test/oauth/token', [
946
+ $response = Http::asForm()->post('https ://passport-app.test/oauth/token', [
947
947
'grant_type' => 'client_credentials',
948
948
'client_id' => 'your-client-id',
949
949
'client_secret' => 'your-client-secret',
@@ -1124,12 +1124,12 @@ When requesting an access token using the authorization code grant, consumers sh
1124
1124
Route::get('/redirect', function () {
1125
1125
$query = http_build_query([
1126
1126
'client_id' => 'your-client-id',
1127
- 'redirect_uri' => 'http ://example .com/callback',
1127
+ 'redirect_uri' => 'https ://third-party-app .com/callback',
1128
1128
'response_type' => 'code',
1129
1129
'scope' => 'user:read orders:create',
1130
1130
]);
1131
1131
1132
- return redirect('http ://passport-app.test/oauth/authorize?'.$query);
1132
+ return redirect('https ://passport-app.test/oauth/authorize?'.$query);
1133
1133
});
1134
1134
```
1135
1135
0 commit comments