Keycloak 授权:CRUD 授权策略、API 权限 [英] Keycloak authorization: CRUD Authorization Policies, Permissions via API

查看:54
本文介绍了Keycloak 授权:CRUD 授权策略、API 权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Keycloak 中,我看到有一个 CRUD API 来创建资源(和范围):

http:///${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set

<块引用>

创建资源集描述:POST/resource_set读取资源集描述:GET/resource_set/{_id}更新资源集描述:PUT/resource_set/{_id}删除资源集说明:DELETE/resource_set/{_id}

但我没有看到 CRUD 授权策略、权限的 API.

我尝试通过 protection/resource_set 端点创建策略但失败了:

POST: "policies":[ {...} ]=> 无法识别的字段policies"

有没有办法通过 API CRUD 授权策略/权限?

(我没有使用 Java 客户端 - 我想和邮递员一起做)

任何帮助将不胜感激

解决方案

好的找到了...

当请求这样的 API 端点时,您可以访问策略/权限:

http://${host}:${port}/auth/admin/realms/${realm_name}/clients/${client_id}/authz/resource-server/policy/user/${policy_id}

但是我仍然无法在官方文档中找到有关此内容的内容...

In Keycloak I see there is a CRUD API to create a resource (and scopes):

http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set

Create resource set description: POST /resource_set
Read resource set description: GET /resource_set/{_id}
Update resource set description: PUT /resource_set/{_id}
Delete resource set description: DELETE /resource_set/{_id}

But I don't see an API to CRUD Authorization Policies, Permissions.

I tried to create policies via the protection/resource_set endpoint but failed:

POST: "policies":[ {...} ] => Unrecognized field "policies"

Is there a way to CRUD Authorization Policies/Permissions via API?

(I'm not using a java client - I want to do this with postman)

Any help would be grateful

解决方案

Ok found something ...

When requesting API endpoints like this you get the access to policies/permissions:

http://${host}:${port}/auth/admin/realms/${realm_name}/clients/${client_id}/authz/resource-server/policy/user/${policy_id}

But I still can't find something in the official documentation about this ...

这篇关于Keycloak 授权:CRUD 授权策略、API 权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆