logicpanel / keycloak-php-sdk
PHP wrapper for the KeyCloak admin API
Installs: 1 357
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.3
- ext-json: *
- guzzlehttp/guzzle: ^5.3|^6.3
- league/oauth2-client: ^2.4
Requires (Dev)
- phpunit/phpunit: ^7.5
- symfony/dotenv: ^4.3
README
This package aims to wrap the Keycloak API and provide an easy and consistent layer for managing your keycloak realms.
Documentation
Quick start
First create a KeycloakClient with your credentials.
$kcClient = new Keycloak\KeycloakClient( 'my-client-id', 'my-client-secret', 'my-realm', 'https://my-keycloak-base-url.com' );
Or use a admin user credentials.
$kcClient = new Keycloak\KeycloakPasswordClient( 'my-realm', 'https://my-keycloak-base-url.com', 'username', 'password' );
Then you can pass the client to any of the APIs.
$userApi = new Keycloak\User\Api($kcClient); $allUsers = $userApi->findAll();
Tested platforms
These are the platforms which are officially supported by this package. Any other versions will probably work but is not guaranteed.
Platform | Version |
---|---|
PHP | 7.3 |
Keycloak | 11 |
Contributing
Please read our contribution guidelines before contributing.