PHP code example of omniglies / laravel-sso-client
1. Go to this page and download the library: Download omniglies/laravel-sso-client 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/ */
omniglies / laravel-sso-client example snippets
return [
// User model to use for authentication
'user_model' => 'App\\Models\\User',
// Default role for new SSO users (, 'address', 'nip_pbb',
'kd_propinsi', 'kd_dati2', 'kd_kecamatan', 'kd_kelurahan'
],
// Redirect path after successful login
'redirect_after_login' => '/home',
// Route configuration
'route_prefix' => 'sso',
'middleware' => ['web'],
];
use Omniglies\LaravelSsoClient\Services\SsoUserService;
$ssoService = new SsoUserService();
// Search users ( OAuth server
$newUser = $ssoService->withToken($adminToken)->createUser([
'name' => 'John Doe',
'email' => '[email protected]',
'username' => 'johndoe',
'password' => 'password'
]);
// Sync local user with OAuth server
$ssoService->syncLocalUser($user);