PHP code example of ssrahman / passport-custom-jwt-claims
1. Go to this page and download the library: Download ssrahman/passport-custom-jwt-claims library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ssrahman / passport-custom-jwt-claims example snippets
return [
/*
|--------------------------------------------------------------------------
| User Claims
|--------------------------------------------------------------------------
|
| User claims will be loaded from the properties of the auth providers model
| specified in the auth config file.
|
*/
'user_claims' => [
'name' => 'name',
'email' => 'email',
],
/*
|--------------------------------------------------------------------------
| App claims
|--------------------------------------------------------------------------
|
| App claims are static and will be given the specified value across all
| tokens issued by the app.
|
*/
'app_claims' => [
'iss' => env('APP_URL')
]
];