stand_alone: true ipr: none cat: std # Check submissiontype: IETF wg: OpenID TBD
docname: authorization-api-1_0
title: Authorization API abbrev: azapi lang: en kw:
author:
normative: RFC4001: # text representation of IP addresses RFC5234: # REPLACE RFC6749: #OAuth RFC6750: #OAuth 2.0 Bearer Tokens RFC8259: #JSON RFC9110: # HTTP Semantics XACML: title: eXtensible Access Control Markup Language (XACML) Version 1.1 target: https://www.oasis-open.org/committees/xacml/repository/cs-xacml-specification-1.1.pdf author: - name: Simon Godik role: editor org: Overxeer - name: Tim Moses (Ed.) role: editor org: Entrust date: 2006
–- abstract
The Authorization API enables Policy Decision Points (PDPs) and Policy Enforcement Points (PEPs) to communicate authorization requests and decisions to each other without requiring knowledge of each other's inner workings. The Authorization API is served by the PDP and is called by the PEP. The Authorization API includes an Evaluations endpoint, which provides specific access decisions and a Search endpoint, which provides generalized access capabilities.
–- middle
Computational services often implement access control within their components by separating Policy Decision Points (PDPs) from Policy Enforcement Points (PEPs). PDPs and PEPs are defined in XACML ({{XACML}}) and NIST's ABAC SP 800-162. Communication between PDPs and PEPs follows similar patterns across different software and services that require or provide authorization information. The Authorization API described in this document enables different providers to offer PDP and PEP capabilities without having to bind themselves to one particular implementation of a PDP or PEP.
The Authorization API is a transport-agnostic API published by the PDP, to which the PEP acts as a client. The Transport section of this specification will detail possible bindings e.g. REST.
Authorization for the Authorization API itself is out of scope for this document, since authorization for REST APIs is well-documented elsewhere. For example, the Authorization API MAY support authorization using an Authorization
header, using a basic
or bearer
token. Support for OAuth 2.0 ({{RFC6749}}) is RECOMMENDED.
The Authorization API has two main features:
The Authorization API has two parts, Access Evaluation and Search. Each of these is defined below. The definition is transport-agnostic. Refer to the Transport section for example bindings.
This document describes the API version 1. Any updates to this API through subsequent revisions of this document or other documents MAY augment this API, but MUST NOT modify the API described here. Augmentation MAY include additional API methods or additional parameters to existing API methods, additional authorization mechanisms, or additional optional headers in API requests. All API methods for version 1 MUST be immediately preceded by the relative URL path /v1/
.
A Subject is the user or robotic principal about whom the Authorization API is being invoked. The Subject may be requesting access at the time the Authorization API is invoked, or the Subject may be of interest in a Search API call.
A Subject is a JSON ({{RFC8259}}) object that contains any number of key-value pair attributes e.g.
An attribute can be single-valued or multi-valued. It can be a primitive type (string, boolean…) or a complex type such as a JSON object.
Here are sample fields:
string
, which uniquely identifies the user within the scope of a PEP. This identifier could be an email address, or it might be an internal identifier such as a UUID or employee ID.string
, which is a {{RFC4001}} text representation of the IP Addressstring
, which uniquely identifies the device of the SubjectThe following non-normative example describes a Subject:
{: #subjectexample title="Example Subject Object"}
A Resource is the target of an access request. It is a JSON ({{RFC8259}}) object that is constructed just like a Subject object.
string
specifying the identifier of the resource. This field MAY be omitted to indicate a class of resourcesstring
that specifies the type of the resourceThe following is a non-normative example of a Resource:
{: #resourceexample title="Example Resource"}
An action is the type of access that the requester intends to perform. There are common actions defined herein, or the action may be custom, which could be specific to the application being accessed or shared across applications but not listed in the common actions below. Action is a JSON ({{RFC8259}}) object that is constructed just like a Subject or Resource object.
The following common actions are defined herein:
resource
field in the requestPolicies MAY incorporate common action names to provide different decisions based on the action
Any action that is not one of the above is custom. Policies MAY incorporate custom action names if decisions need to be taken differently for different custom actions
The Context object is a set of attributes that represent environmental or contextual data about the request such as time of day. It is a JSON ({{RFC8259}}) object that is constructed just like a Subject, Resource, or Action object.
The request follows a format similar to that used in XACML-JSON (TBD add normative reference) or AWS Cedar i.e. a collection of attributes grouped together in categories that reflect the grammatical purpose or function of said attribute. This specification defines 4 such categories as aforementioned:
The simplest form of a response is simply a string representing a decision. In this specification, assuming the evaluation was successful, there are only 2 possible responses:
In addition to a decision, a response may contain:
Reasons MAY be provided by the PDP.
A Reason Field is a JSON object that has keys and values of type string
. The following are non-normative examples of Reason Field objects:
A Reason Object specifies a particular reason. It is a JSON object that has the following fields:
The following is a non-normative example of a Reason Object:
{: #example-reason-object title="Example of a Reason Object"}
An Resource Query is a question about whether a subject can access a specific resource. It is a JSON object with the following fields:
string
that describes the action. This value of this field is as described in the Actions section ({{actions}}).The following is a non-normative example of an Resource Query:
{: #example-resource-query title="Example Resource Query"}
An Resource Query Decision is a tuple of an resource, action and a decision, represented as a JSON object. It has the following fields:
resource
and action
. The format is as described in the Query Decision section ({{query-decision}})The following is a non-normative example of an Resource Query Decision:
{: #example-resource-query-decision title="Example Resource Query Decision"}
An API request or response MAY contain a collection of items, such as an array of strings representing various attribute names, or an array of Resource Query Decision objects ({{resource-query-decision}}). The objects in a collection MAY overlap in scope. For example:
{: #collection-example title="Example Overlapping Collection"}
The receiver of a collection MUST interpret the collection in a way that results in the least-privilege access. In the above example, this means that the subject has access to the resource identified by "1234", but not to the "homeAddress" and "title" attributes of that resource.
The following error responses are common to all methods of the Authorization API. The error response is indicated by an HTTP status code ({{Section 15 of RFC9110}}) that indicates error.
The following errors are indicated by the status codes defined below:
Code | Description | HTTP Body Content |
---|---|---|
400 | Bad Request | An error message string |
401 | Unauthorized | An error message string |
403 | Forbidden | An error message string |
500 | Internal error | An error message string |
{: #table-error-status-codes title="Error status codes"} |
The Access Evaluations API is a means for a PEP to request decisions for a number of resources for a single request context.
The Access Evaluations API is available at the relative URL /evaluations/
via the POST
HTTP method.
The content of the request body is a JSON Object with the following fields:
The following is a non-normative example of an Access Evaluation Request:
{: #example-access-evaluation-request title="Example of an Access Evaluation Request"}
The success response to an Access Evaluation Request is an Access Evaluation Response. It is a HTTP response of type application/json
. Its body is a JSON object that contains the following fields:
integer
format, expressed as epoch millisecondsinteger
format, expressed at epoch milliseconds, after which the response SHOULD NOT be useddecisions
field. This field is REQUIRED if there is at least one decision in the decisions
field that specifies a reason_ids
field. The content of the reasons
field MUST provide details of every identifier in the reason_ids
fields in the decisions
array.integer
format, that it took to respond to the Access Evaluation Request.Following is a non-normative example of an Access Evaluation Response:
{: #example-access-evaluation-response title="Example of an Access Evaluation Response"}
The Resource Access Search API enables a PEP to find out all resources a subject has access to.
The Resource Access Search API is available at the relative URL /resourcesearch/
via the POST
HTTP method
A Resource Search Request has request parameters and a request body. The request parameters are:
decision
items in a Search Response ({{search-response}}). The API MAY return a smaller number of items but SHOULD NOT return a number of items that is greater than this valueThe content of a Search Request body is a JSON object with the following fields:
string
values as described in the Actions section ({{actions}}).The following is a non-normative example of a Search Request:
{: #example-search-request title="Example Access Request"}
A Resource Query Result is a JSON object representing a single result for a Resource Search Request. The Resource Query result always convey a positive ("Allow") decision. Its body is a JSON object with teh following fields:
The following is a non-normative example of a Resource Query Result:
{: #example-resource-query-result title="Example Resource Query Result"}
The success response to a Resource Search Request is a Resource Search Response. It is a HTTP response of type application/json
. The Resource Search Response contains only positive results: only those Resources that the given Subject has access to. Any Resources not returned are therefore not accessible by the subject.
Its body is a JSON object that contains the following fields:
integer
format, expressed as epoch millisecondsinteger
format, expressed at epoch milliseconds, after which the response SHOULD NOT be usedFollowing is a non-normative example of a Resource Search Response:
{: #example-resource-search-response title="Example of a Resource Search Response"}
The Access Subject Search API does the reverse of the Search API: it enables a PEP or client to find out all the subjects that can access a given resource.
The Access Subject Search API is available at the relative URL /subjectsearch/
via the POST
HTTP method
A Subject Search Request has request parameters and a request body. The request parameters are:
decision
items in a Subject Search Response ({{subject-search-response}}). The API MAY return a smaller number of items but SHOULD NOT return a number of items that is greater than this valueThe content of a Subject Search Request body is a JSON object with the following fields:
string
values as described in the Actions section ({{actions}}).The following is a non-normative example of a Subject Search Request:
{: #example-subject-search-request title="Example Subject Search Request"}
The success response to a Subject Search Request is a Subject Search Response. It is a HTTP response of type application/json
. Its body is a JSON object that contains the following fields:
integer
format, expressed as epoch millisecondsA Subject Query Result is array of Subject Query Decisions ({{example-subject-query-decision}}). It is JSON object combining a subject, a list of resource attribute names and an action. Given that a Subject Query result is expected to be the response to a Subject Search, only positive matches should be returned; i.e., only those subjects that match the search criteria (those subjects that are allowed to access the provided Resource Attributes). Any Subjects absent from the results do not have any access to the Resource. A Subject Query Result has the following fields:
The following is a non-normative example of a Subject Query Decision:
{: #example-subject-query-decision title="Example Subject Query Decision"}
Following is a non-normative example of a Subject Search Response:
{: #example-subject-search-response title="Example of a Subject Search Response"}
All requests to the API MAY have request identifiers to uniquely identify them. The API client (PEP) is responsible for generating the request identifier. If present, the request identifier SHALL be provided using the HTTP Header X-Request-ID
. The value of this header is an arbitrary string. The following non-normative example describes this header:
{: #requestidexample title="Request Id Example"}
A PDP responding to an Authorization API request MUST include a request identifier in the response. The request identifier is specified in the HTTP Response header: X-Request-ID
. If the PEP specified a request identifier in the request, the PDP MUST include the same identifier in the response to that request. If the PEP has not specified a request identifier in the request, the PDP MUST generate a new request identifier in its response to the PEP. The following is an non-normative example of an HTTP Response with this header:
{: #example-response-request-id title="Example HTTP response with a Request Id"}
TBS
TBS
–- back
{: numbered="false"}
This template uses extracts from templates written by {{{Pekka Savola}}}, {{{Elwyn Davies}}} and {{{Henrik Levkowetz}}}.