Read Authorization Attributes
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/environments/{{envID}}/authorizationAttributes' \
--header 'Authorization: Bearer {{accessToken}}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/authorizationAttributes")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("Authorization", "Bearer {{accessToken}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/environments/{{envID}}/authorizationAttributes"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
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))
}
GET /environments/{{envID}}/authorizationAttributes HTTP/1.1
Host: {{apiPath}}
Authorization: Bearer {{accessToken}}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("{{apiPath}}/environments/{{envID}}/authorizationAttributes")
.method("GET", body)
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/environments/{{envID}}/authorizationAttributes",
"method": "GET",
"timeout": 0,
"headers": {
"Authorization": "Bearer {{accessToken}}"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'GET',
'url': '{{apiPath}}/environments/{{envID}}/authorizationAttributes',
'headers': {
'Authorization': 'Bearer {{accessToken}}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "{{apiPath}}/environments/{{envID}}/authorizationAttributes"
payload = {}
headers = {
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/authorizationAttributes');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer {{accessToken}}'
));
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 "net/http"
url = URI("{{apiPath}}/environments/{{envID}}/authorizationAttributes")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer {{accessToken}}"
response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/authorizationAttributes")!,timeoutInterval: Double.infinity)
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "GET"
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
{
"_links": {
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes?limit=25"
}
},
"_embedded": {
"authorizationAttributes": [
{
"_links": {
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/b2904bd0-0093-4830-b9c0-3227522a7279"
}
},
"id": "b2904bd0-0093-4830-b9c0-3227522a7279",
"version": "5e0f2fe4-d7d0-4828-8b61-2acdd7c9492d",
"name": "PingOne",
"fullName": "PingOne",
"description": "Parent attribute for all PingOne attributes.\nThis attribute does not resolve to a value and should not be used in policies.",
"resolvers": [],
"valueType": "STRING",
"managedEntity": {
"owner": {
"service": {
"name": "Editor Service"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/b2904bd0-0093-4830-b9c0-3227522a7279"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/7dadff8c-795d-4a5a-95f8-7942d3e49e70"
}
},
"id": "7dadff8c-795d-4a5a-95f8-7942d3e49e70",
"version": "b4da314a-00e9-4294-80e8-31e7bd42f59e",
"name": "API Access Management",
"fullName": "PingOne.API Access Management",
"description": "Parent attribute for data relating HTTP request/responses to PingOne Authorize API Access Management data configuration.",
"parent": {
"id": "b2904bd0-0093-4830-b9c0-3227522a7279"
},
"resolvers": [],
"valueType": "STRING",
"managedEntity": {
"owner": {
"service": {
"name": "API Access Management"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/7dadff8c-795d-4a5a-95f8-7942d3e49e70"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/76346f37-d495-4e33-b161-e60d6fc986d3"
}
},
"id": "76346f37-d495-4e33-b161-e60d6fc986d3",
"version": "6bbe1bfc-e80f-4d91-b281-b07266564d60",
"name": "API Server",
"fullName": "PingOne.API Access Management.API Server",
"description": "Information about the API server that was matched to an HTTP request/response.",
"parent": {
"id": "7dadff8c-795d-4a5a-95f8-7942d3e49e70"
},
"resolvers": [
{
"type": "REQUEST"
}
],
"valueType": "JSON",
"managedEntity": {
"owner": {
"service": {
"name": "API Access Management"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/76346f37-d495-4e33-b161-e60d6fc986d3"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/145f854e-96cb-4b51-94af-3f8f4328f437"
}
},
"id": "145f854e-96cb-4b51-94af-3f8f4328f437",
"version": "e89f462b-75cf-426e-b89a-934d7f03bc17",
"name": "ID",
"fullName": "PingOne.API Access Management.API Server.ID",
"description": "Uniquely identifies an API server.",
"parent": {
"id": "76346f37-d495-4e33-b161-e60d6fc986d3"
},
"resolvers": [
{
"type": "ATTRIBUTE",
"value": {
"id": "76346f37-d495-4e33-b161-e60d6fc986d3"
}
}
],
"processor": {
"type": "JSON_PATH",
"name": "API Server ID JSON Path Processor",
"expression": "$.id",
"valueType": "STRING"
},
"valueType": "STRING",
"managedEntity": {
"owner": {
"service": {
"name": "API Access Management"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/7dadff8c-795d-4a5a-95f8-7942d3e49e70"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/1097e066-c781-43b8-8a7c-45faaf996aeb"
}
},
"id": "1097e066-c781-43b8-8a7c-45faaf996aeb",
"version": "36addabc-55d6-4859-adb5-1e2d644292f1",
"name": "Operation",
"fullName": "PingOne.API Access Management.Operation",
"description": "Information about the API server operation that was matched to an HTTP request/response.",
"parent": {
"id": "7dadff8c-795d-4a5a-95f8-7942d3e49e70"
},
"resolvers": [
{
"type": "REQUEST"
}
],
"valueType": "JSON",
"managedEntity": {
"owner": {
"service": {
"name": "API Access Management"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/1097e066-c781-43b8-8a7c-45faaf996aeb"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/0a85a233-eb97-4b8d-b042-02a94ecf9a7a"
}
},
"id": "0a85a233-eb97-4b8d-b042-02a94ecf9a7a",
"version": "c581d924-5f2d-45db-b11e-bdda9882d982",
"name": "Name",
"fullName": "PingOne.API Access Management.Operation.Name",
"description": "Uniquely identifies an API server operation.",
"parent": {
"id": "1097e066-c781-43b8-8a7c-45faaf996aeb"
},
"resolvers": [
{
"type": "ATTRIBUTE",
"value": {
"id": "1097e066-c781-43b8-8a7c-45faaf996aeb"
}
}
],
"processor": {
"type": "JSON_PATH",
"name": "API Server Operation Name JSON Path Processor",
"expression": "$.name",
"valueType": "STRING"
},
"valueType": "STRING",
"defaultValue": "",
"managedEntity": {
"owner": {
"service": {
"name": "API Access Management"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/b2904bd0-0093-4830-b9c0-3227522a7279"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/9ac20bf6-7861-456f-ada4-2d09126814bb"
}
},
"id": "9ac20bf6-7861-456f-ada4-2d09126814bb",
"version": "0b5a0205-98c4-4392-8658-0e53037134b5",
"name": "User",
"fullName": "PingOne.User",
"description": "Parent attribute for the user the decision request is being made on behalf of.\n(See PingOne.User.ID for details on how the user is identified from the decision request)\nThis attribute resolves with the data for the currently logged in user.",
"parent": {
"id": "b2904bd0-0093-4830-b9c0-3227522a7279"
},
"resolvers": [
{
"type": "USER",
"query": {
"type": "USER_ID",
"userId": "838757b4-c09d-4538-8077-0585864bd304"
}
}
],
"valueType": "JSON",
"managedEntity": {
"owner": {
"service": {
"name": "Editor Service"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
},
{
"_links": {
"parent": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/9ac20bf6-7861-456f-ada4-2d09126814bb"
},
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/authorizationAttributes/838757b4-c09d-4538-8077-0585864bd304"
}
},
"id": "838757b4-c09d-4538-8077-0585864bd304",
"version": "6ba0f6ed-a622-446e-b3fa-160dd4bbeaef",
"name": "ID",
"fullName": "PingOne.User.ID",
"description": "ID of the user the decision request is being made on behalf of.\nThis value is resolved from the userContext.userId property of the decision request.",
"parent": {
"id": "9ac20bf6-7861-456f-ada4-2d09126814bb"
},
"resolvers": [
{
"type": "CURRENT_USER_ID"
}
],
"valueType": "STRING",
"managedEntity": {
"owner": {
"service": {
"name": "Editor Service"
}
},
"restrictions": {
"readOnly": true,
"disallowChildren": true
}
}
}
]
},
"count": 8,
"size": 8
}