Introducing PHP Keycloak Account API library
Introducing a PHP Keycloak Accounts API library
A very quick update post.
As part of the Day Job tm we have been doing a lot of work with Keycloak, and the Keycloak API. Specifically, interfacing with the new, and largely undocumented, Account management API.
I’ve written a bit about this before, but I wanted to point out that as part of this work we have Open Sourced the library that we’re building.
Add it to your project by using:
|
1 |
composer require aria-php/keycloak-api |
Then you can do the following, example:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
use ARIA\KeycloakAPI\AccountAPI; ... $api = new AccountAPI($client_id, $secret, 'master', 'http://localhost:8080'); $api->setBearer($access_token); $profile = $api->getProfile(); // Make your updates here $api->setProfile($profile); |
Early days right now, but hopefully this will save some of you some time!
Leave a Reply