1
hmz0327 135 天前
client 里好像可以创建 role
|
2
hmz0327 135 天前
创建 user 时可以指定 clientRoles
|
3
yaott2020 OP clientRole 和 role 要怎么关联呢
|
![]() |
4
Casbin 135 天前
@yaott2020 用 casdoor ,可以很容易设置角色的应用权限: https://casdoor.cn/
|
6
hmz0327 135 天前
在 Configure->Roles 里创建的是 realmRole ,Client 里创建的 Role 是 clientRole ,它们的权限范围是不一样的。
|
7
hmz0327 135 天前
我也刚用没多久,懂得也不太多
|
9
hmz0327 135 天前
在用户设置里面是可以关联多个的,切换另一个 client 然后关联就行了。
|
10
hmz0327 135 天前
在 UserRepresentation 类里,clientRoles 是个 Map 类型。
protected Map<String, List<String>> clientRoles; |
11
clickhouse 135 天前 ![]() 不确定 lua-resty-openidc 是否可以拿到用户在特定 client 或者 realm 的 role 信息, 如果可以的话直接判断就行。
如果只能拿到用户基本信息,可以依靠 keycloak 本身去做权限判断和拦截,用这个插件: https://github.com/sventorben/keycloak-restrict-client-auth |
12
yaott2020 OP 11 楼方法可行
|