nawasara/keycloak
Composer 安装命令:
composer require nawasara/keycloak
包简介
Keycloak SSO admin dashboard for Nawasara — manage users and clients with DB-cached snapshots and queue-backed mutations.
README 文档
README
Keycloak SSO admin dashboard for the Nawasara superapp framework. Manage users and clients without leaving Nawasara, backed by local DB snapshots for speed and queue jobs for write auditability.
Features
- Users — list, search, view detail (sessions, roles, attributes), enable/disable, and reset password
- Clients — list, search, create, edit, and delete client applications; reveal and regenerate client secret on demand
- DB-cached + queue pattern — list pages read from
nawasara_keycloak_users/nawasara_keycloak_clientssnapshots; mutations dispatch through queue jobs that update Keycloak and the local snapshot atomically with content-hash conflict detection - Sync info bar — shows last successful sync time, pending mutations, and a link to the audit log
- Test connection — Vault credential page exposes a one-click test that obtains an admin token and queries
/users/countto confirm realm reachability and admin-API access
Installation
composer require nawasara/keycloak
php artisan migrate
php artisan db:seed --class="Nawasara\Keycloak\Database\Seeders\PermissionSeeder" --force
Auto-discovered by Laravel.
Keycloak setup
The package authenticates to Keycloak via the client credentials flow with a confidential client that has admin privileges on the target realm.
- In the Keycloak admin console, open the realm you want to manage.
- Clients → Create client:
- Client type:
OpenID Connect - Client ID: e.g.
nawasara-admin - Client authentication:
On - Authentication flow: tick
Service accounts rolesonly
- Client type:
- After creation, open the new client → Service Account Roles tab → Assign role:
realm-management→ grantmanage-users,manage-clients,view-users,view-clients,view-realm,view-events(and any others you need)
- Open the Credentials tab and copy the client secret.
Storing credentials in Vault
- Open Nawasara →
/nawasara-vault - Select the Keycloak SSO group
- Fill in:
- Base URL — e.g.
https://sso.kominfo.go.id - Realm — the realm you grant admin access to (e.g.
master,kominfo) - Client ID — from step 2 above
- Client Secret — from step 4 above
- Base URL — e.g.
- Save
Click Test Connection in the credential dropdown to verify. A successful test reports the realm's user count.
Pages
| Route | Permission |
|---|---|
/nawasara-keycloak/users |
keycloak.user.view |
/nawasara-keycloak/clients |
keycloak.client.view |
/nawasara-keycloak/sessions |
keycloak.session.view |
Permissions
| Permission | Description |
|---|---|
keycloak.user.view |
View user list and detail |
keycloak.user.manage |
Toggle enable/disable, reset password |
keycloak.user.reset_password |
Reset a user's password |
keycloak.client.view |
View client list and detail |
keycloak.client.manage |
Create / edit / delete client, regenerate secret |
keycloak.client.reveal_secret |
Reveal client secret |
keycloak.session.view |
View active sessions |
keycloak.session.revoke |
Revoke a session |
Author
Pringgo J. Saputro <odyinggo@gmail.com>
License
MIT
nawasara/keycloak 适用场景与选型建议
nawasara/keycloak 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 130 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「SSO」 「laravel」 「user-management」 「oidc」 「iam」 「keycloak」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nawasara/keycloak 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nawasara/keycloak 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nawasara/keycloak 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Orchestra Platform Foundation
Symfony Simple User Bundle
A secure, modern user management system for PHP.
Components for yii 2
A comprehensive Laravel package for user management, roles, permissions, and utilities
统计信息
- 总下载量: 130
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 41
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-09