8.4.2.5. 查询资源
要根据 id
查询资源,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id}
要查询 名称
的资源,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?name=Alice Resource
默认情况下,名称
过滤器将与给定模式匹配的任何资源。要把查询限制为只返回具有相同匹配项的资源,请使用:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?name=Alice Resource&exactName=true
要查询一个 uri
的资源,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?uri=/api/alice
要查询一个 所有者
的资源,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?owner=alice
要查询某个 类型的资源
,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?type=albums
要查询 范围
的资源,请按如下所示发送 HTTP GET 请求:
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?scope=read
查询服务器以获取权限时,使用 前
和 最大
结果的参数来限制结果。