PHP Library for Keycloak Rest API management
The documentation of this project is available at https://keycloak-admin-documentation.readthedocs.io/en/latest/
composer require diegosm/keycloak-admin
First of all create a client on master realm, with name like manager-cli
of type confidential
and need to enable Service Accounts.
You will use to manage your realm, and log in with client_credential grant type.
There have a factory for create keycloakadmin, put there your configuration:
$keycloakAdmin = KeycloakAdminFactory::create(
$username, // your confidential client name
$password, // the client secret
$url // default root url like http://keycloak:8080/auth
);
- Create role composites
- Review and make tests for all exceptions.
- Make realm extra endpoints (i.e. clear sessions).
- Change User access from array to a Class.
Create representation classes
- AuthenticationFlowRepresentation (could be used on realm)
- AuthenticatorConfigRepresentation (could be used on realm)
- ClientScopeRepresentation (could be used on realm)
- IdentityProviderMapperRepresentation (could be used on realm)
- UserFederationMappers (could be used on realm)