The Policy Resolution API enables you to create your own enforcement points when need to support access to large amounts of data (SQL, search engines, big data, etc.) or enforcement need to be done by another system/platform. It is designed to answer questions like: "What access filters need to be set up for a specific user to access an asset?". The response is expected to show the logical filtering of data and/or the list of allowed data items for the user.
Notice
When accessing the Authorization APIs, the URL base/prefix, according to your PlainID PDP LocationFor more information on which Asset Types to use with your PAA or Cloud PDP, refer to Managing Asset Types.
Important note about headers
Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample, if not, ensure you add it to your cURL sample before pasting into your API tool.
Headers
*RequiredHeader | Value | cURL Line |
---|---|---|
content-type | `application/json` | `-H 'Content-Type: application/json' ` |
cURL Sample Guidelines
In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right. They will then appear in the cURL sample on the bottom of the page in the correct format.
Client ID of the Scope
The clientId is required, ensure that it is defined either in the header as X-Client-Id
or in the body as clientId
.
Client Secret ID of the Scope.
You can also authenticate with an Authorization Token (in your API tool). Note that the X-Client-Id is still required, whether in the header or the body. Refer to Setting up an Authentication Method for more information.
{
"entityId": "angela_bell",
"clientId": "[ClientID]",
"clientSecret": "[ClientSecret]",
"entityTypeId": "Application_Users",
"assetList": [
{
"template": "Orders",
"path": "/orders",
"assetAttributes": {
"order_type": [
"credit_card"
],
"customer_type": [
"private"
]
}
}
],
"entityAttributes": {
"region": [
"US"
]
},
"contextData": {
"branch_id": [
"512"
]
},
"environment": {
"code": [
"T221"
]
},
"remoteIp": "1.2.2.1",
"timeZoneOffset": 3.0,
"resourceTypes": [
{
"name": "Accounts",
"attributeList": [
"type"
],
"actions": [
"view"
]
}
],
"includeContext": false,
"includeAccessPolicy": false,
"includeAccessPolicyId": false,
"includeAssetAttributes": false,
"includeIdentity": false,
"accessTokenFormat": "JSON",
"useCache": false
}
Unique identifier of the Identity
Client ID of the Scope
The Client ID is required, ensure that it is defined either in the header as X-Client-Id
or in the body as clientId
.
Client Secret ID of the Scope.
You can also authenticate with an Authorization Token (in your API tool). Note that the X-Client-Id is still required, whether in the header or the body. Refer to Setting up an Authentication Method for more information.
Identity Template ID
List of Identity Attributes and their values.
If not defined, Dynamic groups based on virtual attriutes will not be considered in the Access Decision.
Identity Context data for this request. When specifying this parameter, you are requesting information based on a specific parameter and its value.
For example, Location where the contextData equals a specific branch.
If not defined, Dynamic groups based on context data will not be considered in the Access Decision.
Attributes and their values used in Advanced Conditions or Request Parameters used In Asset Rules.
Environmental parameters need to be defined in policies as request.
If not defined, parametes based on emviromental data will not be considered in the Access Decision.
IP address to be used when validating a Policy. Ensure that your IP Ranges are correct based on an IP calculator. If not defined, the IP considered in the calculation is taken from the X-Forwarded-For (Request header).
To define the offset from UTC time zone. Used in Time Condition.
Contains a list of the Asset's unique identifier and attributes
Asset Template ID
Asset Unique Identifier
This parameter enables you to decrease the payload size by including a list of Asset Types, their Attributes, and/or associated Actions, which also return in the response. If not specified, all resources from all Resource Types will be included. Ensure you are sending either resourceTypes
or allResourceTypes
in the request. Sending both will result in an error.
The name of the Resource Type is the Asset Template ID. This can be found in the Asset Type Settings.
A list of Attributes. This can be found in the Asset Type Settings. The list of Attributes are applied on each resourceType in the request, and if applicable, will be part of the response. If no Attributes are specified, Attributes are not included in the response,.
Ensure that the includeAssetAttributes
parameter is set to true
for the attributeList
parameter to work. If set to false
, Attributes are not returned.
The name of the Action/s. This can be found in the Asset Type Settings. The list of Actions are applied on each resourceType
in the request, and if applicable, will be part of the response. If no Actions are specified, all Actions for each resourceType
are included in the response.
This parameter enables you to decrease the payload size by including a list of Asset Types, their Attributes, and/or associated Actions, which also return in the response. If not specified, all resources from all Resource Types will be included. Ensure you are sending either allResourceTypes
or resourceTypes
in the request. Sending both will result in an error.
A list of Attributes. This can be found in the Asset Type Settings. The list of Attributes are applied on each resourceType
in the request, and if applicable, will be part of the response. If no Attributes are specified, all Attributes for each resourceType are included in the response.
Ensure that the includeAssetAttributes
parameter is set to true
for the attributeList
parameter to work. If set to false
, Attributes are not returned.
The name of the Action/s. This can be found in the Asset Type Settings. The list of Actions are applied on each resourceType
in the request, and if applicable, will be part of the response. If no Actions are specified, all Actions for each resourceType
are included in the response.
Show/hide the context data in the response.
Show/hide the name of the Policy in the response that has granted the specified access.
Show/hide the external id of the Policy in the response that granted the specified access.
Show/hide the Asset Attribute of the Assets in the response. If using the attributeList
in the resourceType
or allResourceTypes
parameters, ensure that this parameter is set to true
.`.
Show/hide the Identity Attribute of the Identity in the response.
Determines the format of the response – whether JSON or JWT.
The Attribute will determine if the response will consider the cache settings or override the cache and preforming full calculation.
Determines the evaluation of Identity Attributes relationship in access decision.
An auto-generated key to set the correlation between the requested object and the response object (optional). When working with a single assetContext object, use the “singleObjectResponse” value to align to the original structure response.
Determines the Asset Context response structure. See our article on Working with Asset Context for more information.
These operational filters should affect the Runtime behavior and results by applying additional filtering which is not directly related to Authorization logic.
Input your sourceID/s here. For information on the sourceID parameter and where to locate it, check out Managing Attribute Sources in the PlainID documentation.
The Attribute will determine if the calculation will skip unneeded or unavailable Identity sources. Refer to the Authorization API article for more information.
Show/hide additionalResponseInfo in the response.
Fail request when Attribute calculation fails.
The Attribute determines if the Resolution attribute displays the nested calculated expression. For more information, refer to Working with Calculated Attributes article for more information.
OK
{
"tokenValidity": 0,
"response": [
{
"access": [],
"privileges": {
"allowed": [
{
"resourceType": "Accounts",
"actions": [
{
"action": "Access",
"asset-attributes-filter": {
"OR": [
{
"OR": [
{
"AND": [
{
"attribute": "location",
"type": "STRING",
"operator": "EQUALS",
"values": [
"Alabama"
],
"match": "any"
}
]
}
]
}
]
}
}
]
}
],
"denied": []
}
}
]
}
Additional response metadata. This response is only returned when the includeAccessPolicy
is set to true, and when the permissionMetadata
object contains one or more properties
An auto-generated key to set the correlation between the requested object and the response object (optional). When working with a single assetContext object, use the “singleObjectResponse” value to align to the original structure response.
Additional response metadata. This response is only returned when the includeAccessPolicy
is set to true, and when the permissionMetadata
object contains one or more properties
Bad Request
Unauthorized
Forbidden
Not Found
Internal Server Error
Not Implemented