aria-php/keycloak-api
Composer 安装命令:
composer require aria-php/keycloak-api
包简介
Tools for interfacing with the Keycloak API
README 文档
README
This repository is the very initial outline for interfacing with the Keycloak account_api.
Usage
To add this to your project:
composer require aria-php/keycloak-api
Supported features
This API wrapper supports the ability to:
Account API
- Retrieve the profile of your user (as identified by your
access_tokensent as a bearer token) - Update the profile
- Set the user's password
e.g.
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);
Authentication
Your user is identified by obtaining an access token from keycloak for the user, and then passing it as a bearer token.
Note: this is the access_token, not the id_token.
Testing
In order to run the unit tests you need to set up some environment variables:
KEYCLOAK_USERis the user you're trying to connect toKEYCLOAK_PASStheir passwordKEYCLOAK_REALMthe keycloak realm (e.g. "master")KEYCLOAK_CLIENT_IDthe keycloak client id (e.g. "account")KEYCLOAK_SECRETthe client secretKEYCLOAK_BASEURLthe base URL, e.g. "http://localhost:8080"
You will also need to enable "Direct access grants" for your client.
Licence
LGPLv3 - Please see LICENSE.txt for details.
统计信息
- 总下载量: 899
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2020-10-13