PHP code example of baywa-re-lusy / user-management

1. Go to this page and download the library: Download baywa-re-lusy/user-management 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/ */

    

baywa-re-lusy / user-management example snippets


use BayWaReLusy\UserManagement\UserManagementConfig;
use BayWaReLusy\UserManagement\UserManagement;
use BayWaReLusy\UserManagement\UserService;
use BayWaReLusy\UserManagement\UserService\KeycloakAdapter;

$userManagementConfig = new UserManagementConfig(
    'https://auth-server-address',
    '/token-endpoint',
    '/users-endpoint',
    '/logout-endpoint',
    'client-credentials-client-id',
    'client-credentials-client-secret',
    'uuid-of-frontend-client'
);
$userManagement = new UserManagement($userManagementConfig);
$userService    = $userManagement->get(UserService::class);
$userService->setAdapter($userManagement->get(KeycloakAdapter::class));

$sm->setService(UserManagement::class, $userManagement);