Entitlement with REST APIs
Entitlement management is the process that grants, resolves, enforces, revokes and administers fine-grained access privileges.
The WSO2 Identity Server supports REST APIs for entitlement management via the
https://{IS_IP}:{IS_PORT}/api/identity/entitlement/decision/ endpoint.
If your WSO2 Identity Server is running on localhost (127.0.0.1) and on the default port, the entitlement endpoint is:
https://localhost:9443/api/identity/entitlement/decision/
The REST APIs are secured with basic authentication. Follow the steps below to add a basic auth header when calling these methods.
-
Build a string of the form username:password and encode it using Base64.
-
Define an authorization header with the term
Basic, followed by the encoded string. For example, the basic authorization header foradminuser with passwordadminis:Authorization: Basic YWRtaW46YWRtaW4=
Get API resource list
| Description | Get the API resource list according to XACML 3.0 specification. | |||||||||||||||||||||||||
| Resource Path | /home | |||||||||||||||||||||||||
| HTTP Method | GET | |||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | |||||||||||||||||||||||||
| Authentication | Basic | |||||||||||||||||||||||||
| Username | admin | |||||||||||||||||||||||||
| Password | admin | |||||||||||||||||||||||||
| Parameters |
| |||||||||||||||||||||||||
| Response |
|
A sample request and response is as follows:
| Sample request | GET Request: cURL |
| Sample Response | Sample response: JSON |
Evaluate XACML request
| Description | Get a response by evaluating the JSON/XML XACML request. | ||||||||||||||||||||||||||||||
| Resource Path | /pdp | ||||||||||||||||||||||||||||||
| HTTP Method | POST | ||||||||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | ||||||||||||||||||||||||||||||
| Authentication | Basic | ||||||||||||||||||||||||||||||
| Username | admin | ||||||||||||||||||||||||||||||
| Password | admin | ||||||||||||||||||||||||||||||
| Parameters |
| ||||||||||||||||||||||||||||||
| Response |
|
A sample request and response is as follows:
| XACML Policy Evaluated | XACML Policy |
| Sample Request | Request: JSON |
| Sample Response | Response: JSON |
Evaluate XACML request by attributes
| Description | Get a response by evaluating attributes. | ||||||||||||||||||||||||||||||
| Resource Path | /by-attrib | ||||||||||||||||||||||||||||||
| HTTP Method | POST | ||||||||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | ||||||||||||||||||||||||||||||
| Authentication | Basic | ||||||||||||||||||||||||||||||
| Username | admin | ||||||||||||||||||||||||||||||
| Password | admin | ||||||||||||||||||||||||||||||
| Parameters |
| ||||||||||||||||||||||||||||||
| Response |
|
A sample request and response are as follows,
| A sample request | Request: cURL |
| A sample response | Response: JSON |
Evaluate XACML request by attributes and receive boolean response
| Description | Get a boolean response by evaluating attributes. | ||||||||||||||||||||||||||||||
| Resource Path | /by-attrib-boolean | ||||||||||||||||||||||||||||||
| HTTP Method | POST | ||||||||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | ||||||||||||||||||||||||||||||
| Authentication | Basic | ||||||||||||||||||||||||||||||
| Username | admin | ||||||||||||||||||||||||||||||
| Password | admin | ||||||||||||||||||||||||||||||
| Parameters |
| ||||||||||||||||||||||||||||||
| Response |
|
A sample request and response are as follows,
| A sample request | Request: cURL |
| A sample response | Response: Boolean |
Get entitled attributes
| Description | Get entitled attributes for a given set of parameters. | ||||||||||||||||||||||||||||||
| Resource Path | /entitled-attribs | ||||||||||||||||||||||||||||||
| HTTP Method | POST | ||||||||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | ||||||||||||||||||||||||||||||
| Authentication | Basic | ||||||||||||||||||||||||||||||
| Username | admin | ||||||||||||||||||||||||||||||
| Password | admin | ||||||||||||||||||||||||||||||
| Parameters |
| ||||||||||||||||||||||||||||||
| Response |
|
A sample request and response are as follows,
| A sample request | Request: cURL |
| A sample response | Response: JSON |
Get all entitlements
| Description | Get all entitlements for a given set of parameters | ||||||||||||||||||||||||||||||
| Resource Path | /entitlements-all | ||||||||||||||||||||||||||||||
| HTTP Method | POST | ||||||||||||||||||||||||||||||
| Request/Response Format | application/json application/xml | ||||||||||||||||||||||||||||||
| Authentication | Basic | ||||||||||||||||||||||||||||||
| Username | admin | ||||||||||||||||||||||||||||||
| Password | admin | ||||||||||||||||||||||||||||||
| Parameters |
| ||||||||||||||||||||||||||||||
| Response |
|
Was this page helpful?