8.4. 보호 API
Protection API는 다음 기능을 제공하는 UMA 호환 끝점 세트를 제공합니다.
리소스 관리
이 끝점을 사용하면 리소스 서버가 리소스를 원격으로 관리하고 정책 시행자가 서버를 보호해야 하는 리소스에 대해 쿼리할 수 있습니다.
권한 관리
UMA 프로토콜에서 리소스 서버는 이 끝점에 액세스하여 권한 티켓을 생성합니다. Red Hat Single Sign-On은 권한 상태 및 쿼리 권한을 관리하기 위한 엔드포인트도 제공합니다.
정책 API
Red Hat Single Sign-On은 UMA Protection API를 활용하여 리소스 서버가 사용자의 권한을 관리할 수 있도록 합니다. 리소스 및 권한 API 외에도 Red Hat Single Sign-On은 사용자 대신 리소스 서버에서 권한을 리소스로 설정할 수 있는 정책 API를 제공합니다.
이 API의 중요한 요구 사항은 리소스 서버 만 보호 API 토큰(PAT)이라는 특수 OAuth2 액세스 토큰을 사용하여 끝점에 액세스할 수 있다는 것입니다. UMA에서 PAT는 uma_protection 범위가 있는 토큰입니다.
8.4.1. PAT 란 무엇이며 어떻게 얻을 수 있습니까?
PAT( Protected API token)는 uma_protection 으로 정의된 범위가 있는 특수 OAuth2 액세스 토큰입니다. 리소스 서버를 생성할 때 Red Hat Single Sign-On은 해당 클라이언트 애플리케이션에 대한 역할 uma_protection 을 자동으로 생성하여 클라이언트의 서비스 계정과 연결합니다.
uma_protection 역할로 부여된 서비스 계정
리소스 서버는 다른 OAuth2 액세스 토큰과 마찬가지로 Red Hat Single Sign-On에서 PAT를 가져올 수 있습니다. 예를 들어 curl을 사용합니다.
curl -X POST \ -H "Content-Type: application/x-www-form-urlencoded" \ -d 'grant_type=client_credentials&client_id=${client_id}&client_secret=${client_secret}' \ "http://localhost:8080/auth/realms/${realm_name}/protocol/openid-connect/token"
curl -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'grant_type=client_credentials&client_id=${client_id}&client_secret=${client_secret}' \
"http://localhost:8080/auth/realms/${realm_name}/protocol/openid-connect/token"
위의 예제에서는 client_credentials 부여 유형을 사용하여 서버에서 PAT를 가져오는 것입니다. 결과적으로 서버는 다음과 유사한 응답을 반환합니다.
{ "access_token": ${PAT}, "expires_in": 300, "refresh_expires_in": 1800, "refresh_token": ${refresh_token}, "token_type": "bearer", "id_token": ${id_token}, "not-before-policy": 0, "session_state": "ccea4a55-9aec-4024-b11c-44f6f168439e" }
{
"access_token": ${PAT},
"expires_in": 300,
"refresh_expires_in": 1800,
"refresh_token": ${refresh_token},
"token_type": "bearer",
"id_token": ${id_token},
"not-before-policy": 0,
"session_state": "ccea4a55-9aec-4024-b11c-44f6f168439e"
}
Red Hat Single Sign-On은 다양한 방법으로 클라이언트 애플리케이션을 인증할 수 있습니다. 단순화를 위해 client_credentials 부여 유형은 여기에 사용됩니다. client_id 및 client_secret. 지원되는 인증 방법을 사용하도록 선택할 수 있습니다.
8.4.2. 리소스 관리
리소스 서버는 UMA 호환 엔드포인트를 사용하여 리소스를 원격으로 관리할 수 있습니다.
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set
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}
- 리소스 세트 설명 나열: GET /resource_set
이러한 각 작업에 대한 자세한 내용은 UMA 리소스 등록 API 를 참조하십시오.
8.4.2.1. 리소스 생성
리소스를 생성하려면 다음과 같이 HTTP POST 요청을 보내야 합니다.
curl -v -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '{ "name":"Tweedl Social Service", "type":"http://www.example.com/rsrcs/socialstream/140-compatible", "icon_uri":"http://www.example.com/icons/sharesocial.png", "resource_scopes":[ "read-public", "post-updates", "read-private", "http://www.example.com/scopes/all" ] }'
curl -v -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '{
"name":"Tweedl Social Service",
"type":"http://www.example.com/rsrcs/socialstream/140-compatible",
"icon_uri":"http://www.example.com/icons/sharesocial.png",
"resource_scopes":[
"read-public",
"post-updates",
"read-private",
"http://www.example.com/scopes/all"
]
}'
기본적으로 리소스 소유자는 리소스 서버입니다. 특정 사용자와 같은 다른 소유자를 정의하려는 경우 다음과 같이 요청을 보낼 수 있습니다.
curl -v -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '{ "name":"Alice Resource", "owner": "alice" }'
curl -v -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '{
"name":"Alice Resource",
"owner": "alice"
}'
여기서 속성 소유자는
사용자의 사용자 이름 또는 식별자를 사용하여 설정할 수 있습니다.
8.4.2.2. 사용자 관리 리소스 생성
기본적으로 보호 API를 통해 생성된 리소스는 사용자 계정 서비스를 통해 리소스 소유자가 관리할 수 없습니다.
리소스를 생성하고 리소스 소유자가 이러한 리소스를 관리할 수 있도록 하려면 다음과 같이 ownerManagedAccess
속성을 설정해야 합니다.
curl -v -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '{ "name":"Alice Resource", "owner": "alice", "ownerManagedAccess": true }'
curl -v -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '{
"name":"Alice Resource",
"owner": "alice",
"ownerManagedAccess": true
}'
8.4.2.3. 리소스 업데이트
기존 리소스를 업데이트하려면 다음과 같이 HTTP PUT 요청을 보냅니다.
curl -v -X PUT \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id} \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '{ "_id": "Alice Resource", "name":"Alice Resource", "resource_scopes": [ "read" ] }'
curl -v -X PUT \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id} \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '{
"_id": "Alice Resource",
"name":"Alice Resource",
"resource_scopes": [
"read"
]
}'
8.4.2.4. 리소스 삭제
기존 리소스를 삭제하려면 다음과 같이 HTTP DELETE 요청을 보냅니다.
curl -v -X DELETE \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id} \ -H 'Authorization: Bearer '$pat
curl -v -X DELETE \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id} \
-H 'Authorization: Bearer '$pat
8.4.2.5. 리소스 쿼리
id
로 리소스를 쿼리하려면 다음과 같이 HTTP GET 요청을 보냅니다.
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set/{resource_id}
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
기본적으로 이름
필터는 지정된 패턴과 모든 리소스와 일치합니다. 쿼리에서 정확히 일치하는 리소스만 반환하도록 제한하려면 다음을 사용합니다.
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?name=Alice Resource&exactName=true
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://${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://${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://${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
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/resource_set?scope=read
서버에 권한을 쿼리할 때 먼저
매개변수와 max
결과를 사용하여 결과를 제한합니다.
8.4.3. 권한 요청 관리
UMA 프로토콜을 사용하는 리소스 서버는 특정 끝점을 사용하여 권한 요청을 관리할 수 있습니다. 이 끝점은 권한 요청을 등록하고 권한 티켓을 받기 위한 UMA 준수 흐름을 제공합니다.
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission
권한 티켓은 권한 요청을 나타내는 특수한 보안 토큰 유형입니다. UMA 사양에 따라 권한 티켓은 다음과 같습니다.
권한 부여 서버에서 리소스 서버로, 리소스 서버에서 클라이언트로 전달되고 궁극적으로 클라이언트로부터 권한 부여 서버로 전달되는 상관 관계 처리로 권한 부여 서버가 권한 부여 데이터 요청에 적용할 올바른 정책을 평가할 수 있도록 합니다.
대부분의 경우 이 엔드포인트를 직접 처리할 필요가 없습니다. Red Hat Single Sign-On은 리소스 서버에 대해 UMA를 사용하도록 지원하는 정책 시행기를 제공하여 권한 부여 서버에서 권한 티켓을 취득하고 이 티켓을 클라이언트 애플리케이션에 반환하며 최종 요청 당사자 토큰(RPT)에 따라 권한 결정을 시행할 수 있도록 합니다.
Red Hat Single Sign-On에서 권한 티켓을 얻는 프로세스는 일반 클라이언트 애플리케이션이 아닌 리소스 서버에서 수행합니다. 여기서 클라이언트가 리소스에 액세스할 수 있는 권한 부여 없이 보호 리소스에 액세스하려고 하면 권한 티켓을 받습니다. 권한 티켓 발행은 리소스 서버가 다음을 수행할 수 있도록 UMA를 사용할 때 중요한 요소입니다.
- 리소스 서버에서 보호되는 리소스와 연결된 데이터를 클라이언트에서 추상화
- 나중에 리소스 소유자의 동의에 따라 액세스 권한을 부여하기 위해 나중에 워크플로에서 사용할 수 있는 Red Hat Single Sign-On 권한 부여 요청에 등록하십시오.
- 권한 부여 서버에서 리소스 서버를 분리하고 다른 권한 부여 서버를 사용하여 리소스를 보호하고 관리할 수 있도록 합니다.
고객이 안심할 수 있는 권한 티켓에는 다음과 같은 중요한 측면이 있습니다.
- 클라이언트는 권한 부여 데이터가 보호되는 리소스와 어떻게 연관되는지에 대해 알 필요가 없습니다. 고객에게 권한 티켓은 완전히 불투명합니다.
- 클라이언트는 다양한 리소스 서버의 리소스에 액세스하고 다른 권한 부여 서버로 보호할 수 있습니다.
이는 UMA에서 제공하는 몇 가지 이점으로, UMA의 다른 측면이 권한 티켓, 특히 개인 정보 보호 및 사용자가 자신의 리소스에 대한 액세스를 제어하는 것에 기반을 두고 있습니다.
8.4.3.1. 권한 티켓 생성
권한 티켓을 생성하려면 다음과 같이 HTTP POST 요청을 보냅니다.
curl -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '[ { "resource_id": "{resource_id}", "resource_scopes": [ "view" ] } ]'
curl -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '[
{
"resource_id": "{resource_id}",
"resource_scopes": [
"view"
]
}
]'
티켓을 생성할 때 임의의 클레임을 푸시하고 이러한 클레임을 티켓과 연결할 수도 있습니다.
curl -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission \ -H 'Authorization: Bearer '$pat \ -H 'Content-Type: application/json' \ -d '[ { "resource_id": "{resource_id}", "resource_scopes": [ "view" ], "claims": { "organization": ["acme"] } } ]'
curl -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission \
-H 'Authorization: Bearer '$pat \
-H 'Content-Type: application/json' \
-d '[
{
"resource_id": "{resource_id}",
"resource_scopes": [
"view"
],
"claims": {
"organization": ["acme"]
}
}
]'
권한 티켓과 관련된 리소스 및 범위에 대한 권한을 평가할 때 정책에 이러한 클레임을 사용할 수 있습니다.
8.4.3.2. 기타 UMA 호환 끝점
8.4.3.2.1. 권한 티켓 생성
리소스의 소유자가 다음과 같이 id {resource_id}인 특정 리소스에 대한 권한을 id {user_id}인 사용자에게 부여하려면 다음을 수행합니다.
curl -X POST \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \ -H 'Authorization: Bearer '$access_token \ -H 'Content-Type: application/json' \ -d '{ "resource": "{resource_id}", "requester": "{user_id}", "granted": true, "scopeName": "view" }'
curl -X POST \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \
-H 'Authorization: Bearer '$access_token \
-H 'Content-Type: application/json' \
-d '{
"resource": "{resource_id}",
"requester": "{user_id}",
"granted": true,
"scopeName": "view"
}'
8.4.3.2.2. 권한 티켓 받기
curl http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \ -H 'Authorization: Bearer '$access_token
curl http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \
-H 'Authorization: Bearer '$access_token
다음 쿼리 매개변수 중 하나를 사용할 수 있습니다.
-
scopeId
-
resourceId
-
소유자
-
requester
-
granted
-
returnNames
-
first
-
max
8.4.3.2.3. 권한 티켓 업데이트
curl -X PUT \ http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \ -H 'Authorization: Bearer '$access_token \ -H 'Content-Type: application/json' \ -d '{ "id": "{ticket_id}" "resource": "{resource_id}", "requester": "{user_id}", "granted": false, "scopeName": "view" }'
curl -X PUT \
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket \
-H 'Authorization: Bearer '$access_token \
-H 'Content-Type: application/json' \
-d '{
"id": "{ticket_id}"
"resource": "{resource_id}",
"requester": "{user_id}",
"granted": false,
"scopeName": "view"
}'
8.4.3.2.4. 권한 티켓 삭제
curl -X DELETE http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket/{ticket_id} \ -H 'Authorization: Bearer '$access_token
curl -X DELETE http://${host}:${port}/auth/realms/${realm_name}/authz/protection/permission/ticket/{ticket_id} \
-H 'Authorization: Bearer '$access_token
8.4.4. 정책 API를 사용하여 리소스 권한 관리
Red Hat Single Sign-On은 UMA Protection API를 활용하여 리소스 서버가 사용자의 권한을 관리할 수 있도록 합니다. 리소스 및 권한 API 외에도 Red Hat Single Sign-On은 사용자 대신 리소스 서버에서 권한을 리소스로 설정할 수 있는 정책 API를 제공합니다.
Policy API는 다음에서 사용할 수 있습니다.
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/uma-policy/{resource_id}
http://${host}:${port}/auth/realms/${realm_name}/authz/protection/uma-policy/{resource_id}
이 API는 전달자 토큰에 의해 보호되며, 사용자가 대신하여 권한을 관리하기 위해 사용자가 부여한 동의를 리소스 서버에 표시해야 합니다. 전달자 토큰은 다음을 사용하여 토큰 끝점에서 얻은 일반 액세스 토큰일 수 있습니다.
- 리소스 소유자 암호 자격 증명 부여 유형
- 토큰 교환, 대상 사용자가 리소스 서버인 토큰에 대해 일부 클라이언트(공용 클라이언트)에 부여된 액세스 토큰을 교환합니다.
8.4.4.1. 리소스와 권한 연결
권한을 특정 리소스와 연결하려면 다음과 같이 HTTP POST 요청을 보내야 합니다.
curl -X POST \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \ -H 'Authorization: Bearer '$access_token \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name": "Any people manager", "description": "Allow access to any people manager", "scopes": ["read"], "roles": ["people-manager"] }'
curl -X POST \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \
-H 'Authorization: Bearer '$access_token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"name": "Any people manager",
"description": "Allow access to any people manager",
"scopes": ["read"],
"roles": ["people-manager"]
}'
위의 예에서는 resource_id
에 의해 표시되는 리소스에 새 권한을 만들고 연관시키고 있습니다. 여기서 people-manager
역할이 있는 모든 사용자에게 읽기
범위가 부여되어야 합니다.
그룹 사용과 같은 다른 액세스 제어 메커니즘을 사용하여 정책을 생성할 수도 있습니다.
curl -X POST \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \ -H 'Authorization: Bearer '$access_token \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name": "Any people manager", "description": "Allow access to any people manager", "scopes": ["read"], "groups": ["/Managers/People Managers"] }'
curl -X POST \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \
-H 'Authorization: Bearer '$access_token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"name": "Any people manager",
"description": "Allow access to any people manager",
"scopes": ["read"],
"groups": ["/Managers/People Managers"]
}'
또는 특정 클라이언트:
curl -X POST \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \ -H 'Authorization: Bearer '$access_token \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name": "Any people manager", "description": "Allow access to any people manager", "scopes": ["read"], "clients": ["my-client"] }'
curl -X POST \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \
-H 'Authorization: Bearer '$access_token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"name": "Any people manager",
"description": "Allow access to any people manager",
"scopes": ["read"],
"clients": ["my-client"]
}'
또는 JavaScript를 사용하여 사용자 지정 정책도 사용합니다.
Upload Scripts는 더 이상 사용되지 않으며 향후 릴리스에서 제거될 예정입니다. 이 기능은 기본적으로 비활성화되어 있습니다.
-Dkeycloak.profile.feature.upload_scripts=enabled
로 서버를 시작하려면 다음을 수행하십시오. 자세한 내용은 프로필을 참조하십시오.
curl -X POST \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \ -H 'Authorization: Bearer '$access_token \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name": "Any people manager", "description": "Allow access to any people manager", "scopes": ["read"], "condition": "my-deployed-script.js" }'
curl -X POST \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{resource_id} \
-H 'Authorization: Bearer '$access_token \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"name": "Any people manager",
"description": "Allow access to any people manager",
"scopes": ["read"],
"condition": "my-deployed-script.js"
}'
이러한 액세스 제어 메커니즘의 임의의 조합을 설정할 수도 있습니다.
기존 권한을 업데이트하려면 HTTP PUT 요청을 다음과 같이 보냅니다.
curl -X PUT \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{permission_id} \ -H 'Authorization: Bearer '$access_token \ -H 'Content-Type: application/json' \ -d '{ "id": "21eb3fed-02d7-4b5a-9102-29f3f09b6de2", "name": "Any people manager", "description": "Allow access to any people manager", "type": "uma", "scopes": [ "album:view" ], "logic": "POSITIVE", "decisionStrategy": "UNANIMOUS", "owner": "7e22131a-aa57-4f5f-b1db-6e82babcd322", "roles": [ "user" ] }'
curl -X PUT \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{permission_id} \
-H 'Authorization: Bearer '$access_token \
-H 'Content-Type: application/json' \
-d '{
"id": "21eb3fed-02d7-4b5a-9102-29f3f09b6de2",
"name": "Any people manager",
"description": "Allow access to any people manager",
"type": "uma",
"scopes": [
"album:view"
],
"logic": "POSITIVE",
"decisionStrategy": "UNANIMOUS",
"owner": "7e22131a-aa57-4f5f-b1db-6e82babcd322",
"roles": [
"user"
]
}'
8.4.4.2. 권한 제거
리소스와 관련된 권한을 제거하려면 다음과 같이 HTTP DELETE 요청을 보냅니다.
curl -X DELETE \ http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{permission_id} \ -H 'Authorization: Bearer '$access_token
curl -X DELETE \
http://localhost:8180/auth/realms/photoz/authz/protection/uma-policy/{permission_id} \
-H 'Authorization: Bearer '$access_token
8.4.4.3. 권한 쿼리
리소스와 관련된 권한을 쿼리하려면 다음과 같이 HTTP GET 요청을 보냅니다.
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?resource={resource_id}
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?resource={resource_id}
이름이 지정된 권한을 쿼리하려면 다음과 같이 HTTP GET 요청을 보냅니다.
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?name=Any people manager
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?name=Any people manager
특정 범위와 관련된 권한을 쿼리하려면 다음과 같이 HTTP GET 요청을 보냅니다.
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?scope=read
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy?scope=read
모든 권한을 쿼리하려면 HTTP GET 요청을 다음과 같이 보냅니다.
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy
http://${host}:${port}/auth/realms/${realm}/authz/protection/uma-policy
서버에 권한을 쿼리할 때 먼저
매개변수와 max
결과를 사용하여 결과를 제한합니다.