Authorize Client With MultiRequests JSON Object
POST {{apiPath}}/pdp
The POST /pdp operation authorizes the client using the MultiRequests JSON object. On successful client authorization, the XACML-JSON PDP API invokes the Policy Decision Service with batch decision requests converted from the XACML-JSON request.
The {{apiPath}} variable in this request represents the client’s PingAuthorize host and port. For example, https://<your-pingauthorize-host>:<your-pingauthorize-port>.
Headers
Authorization Bearer {{accessToken}}
Content-Type application/xacml+json
Accept application/xacml+json
Body
raw ( application/xacml+json )
{
"Request": {
"MultiRequests": {
"RequestReference": [{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}]
},
"AccessSubject": [{
"Id": "dom",
"Attribute": [{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}]
}],
"Action": [{
"Id": "act",
"Attribute": [{
"AttributeId": "action",
"Value": "Retrieve"
}]
}],
"Resource": [{
"Id": "srv",
"Attribute": [{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}]
}],
"Environment": [{
"Id": "idp",
"Attribute": [{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}]
}],
"Category": [{
"Id": "att",
"Attribute": [{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}]
}]
}
}
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/pdp' \
--header 'Accept: application/xacml+json' \
--header 'Content-Type: application/xacml+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
"Request": {
"MultiRequests": {
"RequestReference": [{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}]
},
"AccessSubject": [{
"Id": "dom",
"Attribute": [{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}]
}],
"Action": [{
"Id": "act",
"Attribute": [{
"AttributeId": "action",
"Value": "Retrieve"
}]
}],
"Resource": [{
"Id": "srv",
"Attribute": [{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}]
}],
"Environment": [{
"Id": "idp",
"Attribute": [{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}]
}],
"Category": [{
"Id": "att",
"Attribute": [{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}]
}]
}
}'
var options = new RestClientOptions("{{apiPath}}/pdp")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Accept", "application/xacml+json");
request.AddHeader("Content-Type", "application/xacml+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@" ""Request"": {" + "\n" +
@" ""MultiRequests"": {" + "\n" +
@" ""RequestReference"": [{" + "\n" +
@" ""ReferenceId"": [" + "\n" +
@" ""dom""," + "\n" +
@" ""act""," + "\n" +
@" ""srv""," + "\n" +
@" ""idp""," + "\n" +
@" ""att""" + "\n" +
@" ]" + "\n" +
@" }]" + "\n" +
@" }," + "\n" +
@" ""AccessSubject"": [{" + "\n" +
@" ""Id"": ""dom""," + "\n" +
@" ""Attribute"": [{" + "\n" +
@" ""AttributeId"": ""domain""," + "\n" +
@" ""Value"": ""Sales.Asia Pacific""" + "\n" +
@" }]" + "\n" +
@" }]," + "\n" +
@" ""Action"": [{" + "\n" +
@" ""Id"": ""act""," + "\n" +
@" ""Attribute"": [{" + "\n" +
@" ""AttributeId"": ""action""," + "\n" +
@" ""Value"": ""Retrieve""" + "\n" +
@" }]" + "\n" +
@" }]," + "\n" +
@" ""Resource"": [{" + "\n" +
@" ""Id"": ""srv""," + "\n" +
@" ""Attribute"": [{" + "\n" +
@" ""AttributeId"": ""service""," + "\n" +
@" ""Value"": ""Mobile.Landing page""" + "\n" +
@" }]" + "\n" +
@" }]," + "\n" +
@" ""Environment"": [{" + "\n" +
@" ""Id"": ""idp""," + "\n" +
@" ""Attribute"": [{" + "\n" +
@" ""AttributeId"": ""symphonic-idp""," + "\n" +
@" ""Value"": ""Social networks.Spacebook""" + "\n" +
@" }]" + "\n" +
@" }]," + "\n" +
@" ""Category"": [{" + "\n" +
@" ""Id"": ""att""," + "\n" +
@" ""Attribute"": [{" + "\n" +
@" ""AttributeId"": ""attribute:Prospect name""," + "\n" +
@" ""Value"": ""B. Vo""" + "\n" +
@" }]" + "\n" +
@" }]" + "\n" +
@" }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/pdp"
method := "POST"
payload := strings.NewReader(`{
"Request": {
"MultiRequests": {
"RequestReference": [{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}]
},
"AccessSubject": [{
"Id": "dom",
"Attribute": [{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}]
}],
"Action": [{
"Id": "act",
"Attribute": [{
"AttributeId": "action",
"Value": "Retrieve"
}]
}],
"Resource": [{
"Id": "srv",
"Attribute": [{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}]
}],
"Environment": [{
"Id": "idp",
"Attribute": [{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}]
}],
"Category": [{
"Id": "att",
"Attribute": [{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}]
}]
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/xacml+json")
req.Header.Add("Content-Type", "application/xacml+json")
req.Header.Add("Authorization", "Bearer {{accessToken}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /pdp HTTP/1.1
Host: {{apiPath}}
Accept: application/xacml+json
Content-Type: application/xacml+json
Authorization: Bearer {{accessToken}}
{
"Request": {
"MultiRequests": {
"RequestReference": [{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}]
},
"AccessSubject": [{
"Id": "dom",
"Attribute": [{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}]
}],
"Action": [{
"Id": "act",
"Attribute": [{
"AttributeId": "action",
"Value": "Retrieve"
}]
}],
"Resource": [{
"Id": "srv",
"Attribute": [{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}]
}],
"Environment": [{
"Id": "idp",
"Attribute": [{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}]
}],
"Category": [{
"Id": "att",
"Attribute": [{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}]
}]
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/xacml+json");
RequestBody body = RequestBody.create(mediaType, "{\n \"Request\": {\n \"MultiRequests\": {\n \"RequestReference\": [{\n \"ReferenceId\": [\n \"dom\",\n \"act\",\n \"srv\",\n \"idp\",\n \"att\"\n ]\n }]\n },\n \"AccessSubject\": [{\n \"Id\": \"dom\",\n \"Attribute\": [{\n \"AttributeId\": \"domain\",\n \"Value\": \"Sales.Asia Pacific\"\n }]\n }],\n \"Action\": [{\n \"Id\": \"act\",\n \"Attribute\": [{\n \"AttributeId\": \"action\",\n \"Value\": \"Retrieve\"\n }]\n }],\n \"Resource\": [{\n \"Id\": \"srv\",\n \"Attribute\": [{\n \"AttributeId\": \"service\",\n \"Value\": \"Mobile.Landing page\"\n }]\n }],\n \"Environment\": [{\n \"Id\": \"idp\",\n \"Attribute\": [{\n \"AttributeId\": \"symphonic-idp\",\n \"Value\": \"Social networks.Spacebook\"\n }]\n }],\n \"Category\": [{\n \"Id\": \"att\",\n \"Attribute\": [{\n \"AttributeId\": \"attribute:Prospect name\",\n \"Value\": \"B. Vo\"\n }]\n }]\n }\n}");
Request request = new Request.Builder()
.url("{{apiPath}}/pdp")
.method("POST", body)
.addHeader("Accept", "application/xacml+json")
.addHeader("Content-Type", "application/xacml+json")
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/pdp",
"method": "POST",
"timeout": 0,
"headers": {
"Accept": "application/xacml+json",
"Content-Type": "application/xacml+json",
"Authorization": "Bearer {{accessToken}}"
},
"data": JSON.stringify({
"Request": {
"MultiRequests": {
"RequestReference": [
{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}
]
},
"AccessSubject": [
{
"Id": "dom",
"Attribute": [
{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}
]
}
],
"Action": [
{
"Id": "act",
"Attribute": [
{
"AttributeId": "action",
"Value": "Retrieve"
}
]
}
],
"Resource": [
{
"Id": "srv",
"Attribute": [
{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}
]
}
],
"Environment": [
{
"Id": "idp",
"Attribute": [
{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}
]
}
],
"Category": [
{
"Id": "att",
"Attribute": [
{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}
]
}
]
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': '{{apiPath}}/pdp',
'headers': {
'Accept': 'application/xacml+json',
'Content-Type': 'application/xacml+json',
'Authorization': 'Bearer {{accessToken}}'
},
body: JSON.stringify({
"Request": {
"MultiRequests": {
"RequestReference": [
{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}
]
},
"AccessSubject": [
{
"Id": "dom",
"Attribute": [
{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}
]
}
],
"Action": [
{
"Id": "act",
"Attribute": [
{
"AttributeId": "action",
"Value": "Retrieve"
}
]
}
],
"Resource": [
{
"Id": "srv",
"Attribute": [
{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}
]
}
],
"Environment": [
{
"Id": "idp",
"Attribute": [
{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}
]
}
],
"Category": [
{
"Id": "att",
"Attribute": [
{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}
]
}
]
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{apiPath}}/pdp"
payload = json.dumps({
"Request": {
"MultiRequests": {
"RequestReference": [
{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}
]
},
"AccessSubject": [
{
"Id": "dom",
"Attribute": [
{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}
]
}
],
"Action": [
{
"Id": "act",
"Attribute": [
{
"AttributeId": "action",
"Value": "Retrieve"
}
]
}
],
"Resource": [
{
"Id": "srv",
"Attribute": [
{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}
]
}
],
"Environment": [
{
"Id": "idp",
"Attribute": [
{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}
]
}
],
"Category": [
{
"Id": "att",
"Attribute": [
{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}
]
}
]
}
})
headers = {
'Accept': 'application/xacml+json',
'Content-Type': 'application/xacml+json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/pdp');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Accept' => 'application/xacml+json',
'Content-Type' => 'application/xacml+json',
'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n "Request": {\n "MultiRequests": {\n "RequestReference": [{\n "ReferenceId": [\n "dom",\n "act",\n "srv",\n "idp",\n "att"\n ]\n }]\n },\n "AccessSubject": [{\n "Id": "dom",\n "Attribute": [{\n "AttributeId": "domain",\n "Value": "Sales.Asia Pacific"\n }]\n }],\n "Action": [{\n "Id": "act",\n "Attribute": [{\n "AttributeId": "action",\n "Value": "Retrieve"\n }]\n }],\n "Resource": [{\n "Id": "srv",\n "Attribute": [{\n "AttributeId": "service",\n "Value": "Mobile.Landing page"\n }]\n }],\n "Environment": [{\n "Id": "idp",\n "Attribute": [{\n "AttributeId": "symphonic-idp",\n "Value": "Social networks.Spacebook"\n }]\n }],\n "Category": [{\n "Id": "att",\n "Attribute": [{\n "AttributeId": "attribute:Prospect name",\n "Value": "B. Vo"\n }]\n }]\n }\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"
url = URI("{{apiPath}}/pdp")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/xacml+json"
request["Content-Type"] = "application/xacml+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
"Request": {
"MultiRequests": {
"RequestReference": [
{
"ReferenceId": [
"dom",
"act",
"srv",
"idp",
"att"
]
}
]
},
"AccessSubject": [
{
"Id": "dom",
"Attribute": [
{
"AttributeId": "domain",
"Value": "Sales.Asia Pacific"
}
]
}
],
"Action": [
{
"Id": "act",
"Attribute": [
{
"AttributeId": "action",
"Value": "Retrieve"
}
]
}
],
"Resource": [
{
"Id": "srv",
"Attribute": [
{
"AttributeId": "service",
"Value": "Mobile.Landing page"
}
]
}
],
"Environment": [
{
"Id": "idp",
"Attribute": [
{
"AttributeId": "symphonic-idp",
"Value": "Social networks.Spacebook"
}
]
}
],
"Category": [
{
"Id": "att",
"Attribute": [
{
"AttributeId": "attribute:Prospect name",
"Value": "B. Vo"
}
]
}
]
}
})
response = http.request(request)
puts response.read_body
let parameters = "{\n \"Request\": {\n \"MultiRequests\": {\n \"RequestReference\": [{\n \"ReferenceId\": [\n \"dom\",\n \"act\",\n \"srv\",\n \"idp\",\n \"att\"\n ]\n }]\n },\n \"AccessSubject\": [{\n \"Id\": \"dom\",\n \"Attribute\": [{\n \"AttributeId\": \"domain\",\n \"Value\": \"Sales.Asia Pacific\"\n }]\n }],\n \"Action\": [{\n \"Id\": \"act\",\n \"Attribute\": [{\n \"AttributeId\": \"action\",\n \"Value\": \"Retrieve\"\n }]\n }],\n \"Resource\": [{\n \"Id\": \"srv\",\n \"Attribute\": [{\n \"AttributeId\": \"service\",\n \"Value\": \"Mobile.Landing page\"\n }]\n }],\n \"Environment\": [{\n \"Id\": \"idp\",\n \"Attribute\": [{\n \"AttributeId\": \"symphonic-idp\",\n \"Value\": \"Social networks.Spacebook\"\n }]\n }],\n \"Category\": [{\n \"Id\": \"att\",\n \"Attribute\": [{\n \"AttributeId\": \"attribute:Prospect name\",\n \"Value\": \"B. Vo\"\n }]\n }]\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{apiPath}}/pdp")!,timeoutInterval: Double.infinity)
request.addValue("application/xacml+json", forHTTPHeaderField: "Accept")
request.addValue("application/xacml+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
200 OK
{
"Response": [
{
"Decision": "Permit",
"Obligations": [
{
"Id": "obligation-id",
"AttributeAssignments": [
{
"AttributeId": "payload",
"Value": "payload-value"
}
]
}
],
"AssociatedAdvice": [
{
"Id": "advice-id",
"AttributeAssignments": [
{
"AttributeId": "payload",
"Value": "payload-value"
}
]
}
]
}
]
}