srlopes/laravel-keycloak-admin
Composer 安装命令:
composer require srlopes/laravel-keycloak-admin
包简介
This package supports Keycloak administrator client API, authenticating with username and password or using the security key (client_secret)
README 文档
README
composer require srlopes/laravel-keycloak-admin
laravel-keycloak-admin
Add these environment variables to your .env :
KEYCLOAK_ADMIN_BASE_URL=http://keycloak-domain.example/auth
KEYCLOAK_ADMIN_REALM_LOGIN=
KEYCLOAK_ADMIN_REALM=
# Choose to fill in user name and password or client_id and client_secret
KEYCLOAK_ADMIN_USERNAME=
KEYCLOAK_ADMIN_PASSWORD=
KEYCLOAK_ADMIN_CLIENT_ID=
KEYCLOAK_ADMIN_CLIENT_SECRET= # clients -> your_client -> credentials
KEYCLOAK_ADMIN_BASE_URL_REALM=${KEYCLOAK_BASE_URL}/admin/realms/${KEYCLOAK_ADMIN_REALM}
Enable realm managment
Go to clients -> your_client -> Service Account then select realm-managment
from Client Roles list and assign realm-admin to client.
available methods :
Package has provided services as below :
- user
- role
- client
- clientRole
- group (get, update, count, delete, members)
Publish the config file:
php artisan vendor:publish --provider="KeycloakAdm\KeycloakAdminServiceProvider"
All api's are in config\keycloakAdmin.php
For every api just call api name as method on related service .
example:
use KeycloakAdm\Facades\KeycloakAdmin; KeycloakAdm::user()->create([ 'body' => [ // https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_userrepresentation 'username' => 'foo' ] ]); KeycloakAdmin::user()->all([ 'query' => [ 'email' => 'email@email.com' ] ]) KeycloakAdm::user()->update([ 'id' => 'user_id', 'body' => [ // https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_userrepresentation 'username' => 'foo' ] ]); KeycloakAdm::role()->get([ 'id' => 'role_id' ]);
All other api calls are same as examples just need to see required parameters for every api in https://www.keycloak.org/docs-api/11.0/rest-api/index.html
srlopes/laravel-keycloak-admin 适用场景与选型建议
srlopes/laravel-keycloak-admin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.02k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「keycloak」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 srlopes/laravel-keycloak-admin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 srlopes/laravel-keycloak-admin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 srlopes/laravel-keycloak-admin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Auth package against Keycloak for Saml and Openid-Connect
🔑 Simple Keycloak Guard for Laravel
Keycloak OAuth2 client
Alfabank REST API integration
AXIUM Identity Symfony Bundle - Client d'authentification centralisée OAuth2/Keycloak
Simple Keycloak Guard to Laravel Web Routes
统计信息
- 总下载量: 2.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-08