Skip to main content

Generalized Policy Management profile for OAuth 2.x

1 Introduction

This section is not normative.

This document provides a mapping profile for Generalized Policy Management (GPM), targeting the OAuth 2.x Authorization Framework. In particular, it maps parameters of the following specifications on the GPM model.

  • RFC 6749

  • @draft-ietf-oauth-v2-1

  • RFC 7521

  • RFC 7523

  • RFC 7636

  • RFC 8628

  • RFC 8693

  • RFC 8707

  • RFC 9101

  • RFC 9126

  • RFC 9396

  • @oauth-client-id-metadata-document

  • @draft-ietf-oauth-identity-chaining

  • OAuth 2.0 Multiple Response Type Encoding Practices (OpenID)
  • OAuth 2.0 Form Post Response Mode

It also takes into account the considerations from the following specifications.

  • BCP 240
    • RFC 9700

2 Mapping OAuth 2.x to GPM

RFC 6749 defines the request parameters for several protocol flows and endpoints. This document specifies GPM mappings for the authorization request~[@map-authz] and the token request~[@map-token]. Parameters that can occur in both kinds of requests are addressed first~[@map-common].

2.1 Common request parameters

The following parameters can occur in the authorization request as well as in the token request, depending on the OAuth 2.x protocol flow.

All OAuth 2.x request map to a single Policy, which MUST only contain authorization Rules.

2.1.1 scope

The scope property is defined in RFC 6749 as optional, but required by several OAuth 2.0 extensions. Its value is a space-delimited list of case-sensitive strings, representing a set of scopes (defined by the authorization server), which outline the type of access the request is concerned with.

Mapping:

If an OAuth 2.x request contains the scope property, then for each combination of other rule parameters, the mapping MUST contain one rule per listed scope, such that

  • the mode of the rule is authorization;

  • the class of the rule's operation is set to urn:example:gpm:ops:oauth_legacy;

  • the action of the rule's operation is set to the value of the scope property, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.

2.1.2 resource

The resource property is defined in RFC 8707 (Resource Indicators for OAuth 2.0) as optional.1 Its value is an absolute URI or an array of absolute URIs (when the property occurs multiple times), representing the identity of the "target" service or resource the request is concerned with.

Mapping:

If an OAuth 2.x request contains the resource property, then for each combination of other rule parameters, the mapping MUST contain one rule per listed scope, such that the provider of the rule's operation is an object with as location the value of the resource property, prefixed with urn:example:gpm:fallback: if it is not a valid IRI.

2.1.3 authorization_details

The authorization_details property is defined in RFC 9396 (Rich Authorization Requests) as optional. Its value is an array of objects, each of which represents an independent set of authorization requirements the request is concerned with. RFC 9396 lists a minimal, extendable set of fields each object in the array can contain.

  • The type field, required by RFC 9396, has as value a unique string, which determines the kind of requirements the object can contain.

  • The optional actions field has as value an array of strings, representing the "kinds of actions" this authorization requirement is concerned with.

  • The optional privileges field has as value an array of strings, representing the "levels of privilege" this authorization requirement is concerned with.

  • The optional datatypes field has as value an array of strings, representing the "kinds of data" this authorization requirement is concerned with.

  • The optional identifier field has as value a unique string, "identifying" a specific resource in the context of this authorization requirement.

  • The optional locations field has as value an array of strings, representing the "location" of the resource this authorization requirement is concerned with, typically the URI of the RS.

A single authorization details object represents the authorization requirements for each combination of values from its fields, i.e., for each entry in their product set.

Mapping:

If an OAuth 2.x request contains the authorization_details property, then for each authorization details object, the mapping MUST contain a single rule per entry in the product set of that object's parameters, such that

  • the mode of the rule is authorization;

  • the class of the rule's operation is the value of the entry's type property, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI;

  • the action of the rule's operation is an object with

    • the value of the entry's privileges property -- if any -- as class, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI;

    • the value of the entry's actions property -- if any -- as id, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI;

  • the target of the rule's operation is an object with

    • the value of the entry's datatypes property -- if any -- as class, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI,

    • the value of the entry's identifier property -- if any -- as id, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI;

  • the provider of the rule's operation is an object with

    • the value of the entry's locations property -- if any -- as identifier, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.

2.1.4 client_id

The client_id property is defined in RFC 6749 as required -- at least as far as the client identification mechanism needs it.2 Its value is a unique string,3 which functions as an opaque handle that identifies the client within the context of the AS. Typically, it is issued by the latter, and bound to the registered information of provided by the former.

Mapping:

If an OAuth 2.x request contains the client_id property, the negotiation client in its mapping MUST be an object with the value of the client_id property as identifier, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.

2.2 Authorization request parameters

The following additional parameters can occur in OAuth 2.x authorization requests. They MUST be processed together with the mappings defined in~[@map-common], resulting in a single Policy containing only authorization Rules.

With the introduction of RFC 9101 (OAuth 2.0 JWT-Secured Authorization Request) and RFC 9126 (OAuth 2.0 Pushed Authorization Request), authorization request parameters can also be defined in a Request Object, transferred either as a JWT value in the request property, or as an absolute URI reference to a JSON document in the request_uri property. To process an OAuth 2.x request in which either of these properties is present, the request parameters MUST be taken from Request Object in question.

2.2.1 response_type

The response_type property is defined by RFC 6749 as required. Its value is a string containing a space-delimited sequence of labels, which represent the protocol flows the client wants to use, and determine further parameters for the interaction.

Mapping:

The OAuth 2.x profile for GPM currently does not provide a mapping for the response_type property. Only the authorization code flow, with the value code, is supported, since the other flows (implicit and hybrid) are inherently insecure (cf. BCP 240 / RFC 9700, and draft-ietf-oauth-v2-1).

2.2.2 response_mode

The response_mode property is defined in OpenID's OAuth 2.0 Multiple Response Type Encoding Practices, as optional. Its value is a string, indicating how the AS should return parameters to the client in response to authorization request.

The specification defines two initial values: fragment, and query, indicating whether the response parameters should be appended to the redirect_uri as an URI fragment or as URI query parameters -- the latter being the default for the authorization code flow. Additionally, oauth-v2-form-post-response-mode-1_0 defines a third value: form_post, indicating that the response parameters are to be sent as the application/x-www-form-urlencoded body of a HTTP POST operation.

Mapping:

The negotiate object in the mapping of an OAuth 2.x authorization request MUST contain the value of the response_mode property as notification method, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.

2.2.3 redirect_uri

The redirect_uri property is defined by RFC 6749 as required, unless the client is registered with exactly one redirect URI. Its value is a string, namely one of the (absolute) URIs -- previously established with the AS -- to which the AS will redirect the user-agent when the interaction is finished.

Mapping:

  • The negotiate object in the mapping of an OAuth 2.x authorization request MUST contain the value of the redirect_uri property as notification uri.

  • If the request does not contain the code_challenge property, the negotiate object in the request's mapping MUST contain the value of the redirect_uri property as challenge, and have the value plain as hash algorithm.

2.2.4 state

The state property is defined in RFC 6749 as recommended. Its value is a string, which functions as an opaque nonce, provided by the client and returned by the AS to maintain a link between request and callback.

Mapping:

The negotiate object in the mapping of an OAuth 2.x authorization request MUST contain the value of the state property as nonce.

2.2.5 code_challenge

The code_challenge property is defined in RFC 7636 as required, and is taken up by RFC 9700 (BCP 240) as required for public clients and recommended for private clients, if the grant_type is authorization_code.4 Its value is a string, namely the PKCE code challenge derived from the code verifier.

Mapping:

If an OAuth 2.x authorization request contains the code_challenge property, the negotiate object in the request's mapping MUST contain the property's value as challenge.

2.2.6 code_challenge_method

The code_challenge_method property is defined in RFC 7636 as recommended, and is taken up by RFC 9700 (BCP 240) as recommended if the grant_type is authorization_code.5 Its value is a string, indicating the PKCE code verifier transformation method.

RFC 7636 defines two such methods, i.e., S256 and plain, and specifies that the property defaults to plain if not present in the request.

Mapping:

If an OAuth 2.x authorization request contains the code_challenge_method property, the negotiate object in the request's mapping MUST contain the property's value as hash algorithm.

2.3 Token request parameters

The following additional parameters can occur in OAuth 2.x token requests. They MUST be processed together with the mappings defined in~[@map-common], resulting in a single Policy containing only authorization Rules.

2.3.1 audience

The audience property is defined in RFC 8693 (OAuth 2.0 Token Exchange) as recommended.6 Its value is a (case-sensitive?) strings or an array of such strings, representing the target service(s) intended to process the requested action.

Mapping:

If an OAuth 2.x request contains the audience property, then for each combination of other rule parameters, the mapping MUST contain one rule per listed audience, such that the provider of the rule's operation is an object with as id the value of the audience property, prefixed with urn:example:gpm:fallback: if it is not a valid IRI.

2.3.2 redirect_uri

The redirect_uri property is defined in RFC 6749 as required if the grant_type is authorization_code and the same property was also present in the authorization request.7 Its value is a string that is identical to the value of the same parameter in the authorization request.

Mapping:

If an OAuth 2.x token request does not contain the code_verifier property, the negotiate object in the request's mapping MUST contain the value of the redirect_uri as verifer.

2.3.3 code_verifier

The code_verifier property is defined in RFC 7636 as required, and is taken up by RFC 9700 (BCP 240) as required for public clients and recommended for private clients, if the grant_type is authorization_code.8 Its value is a string, namely the original PKCE code verfiier.

Mapping:

If an OAuth 2.x token request contains the code_verifier property, the negotiate object in the request's mapping MUST contain the property's value as verifer.

2.3.4 grant_type

The grant_type property is defined in RFC 6749 as required.9 Its value is a string, representing the type of authorization grant the client provides in this request, which determines further requirements the request needs to conform to.

Mapping:

The authorization grant provided in an OAuth 2.x request MUST be mapped to an assertion about the negotiation client, the class of which MUST be the value of the request's grant_type property, prefixed with urn:example:gpm:fallback: if it is not a valid IRI.

2.3.4.1 code

The code property is defined in RFC 6749 as required if the grant_type is authorization_code. Its value is a string, namely the authorization code the client has received from the AS in response to a successful authorization request.

Mapping:

For OAuth 2.x requests with authorization_code as grant_type, the assertion of the negotiation client in the mapping (cf. supra) MUST have as value the code provided by the request.

2.3.4.2 refresh_token

The refresh_token property is defined in RFC 6749 as required if the grant_type is refresh_token. Its value is a string, namely the latest refresh token the client has received from the AS in response to a successful token request.

Mapping:

For OAuth 2.x requests with refresh_token as grant_type, the assertion of the negotiation client in the mapping (cf. supra) MUST have as value the refresh_token provided by the request.

2.3.4.3 client_secret

The client_secret property is defined in RFC 6749 as required if the grant_type is client_credentials. Its value is a secret string, which the client provides as a password to authenticate itself with.

Mapping:

For OAuth 2.x requests with client_credentials as grant_type, the assertion of the negotiation client in the mapping (cf. supra) MUST have as value the client_secret provided by the request.

2.3.4.4 device_code

The device_code property is defined in RFC 8628 as required, with the grant_type being device_code. Its value is a secret string, which the client provides as a device verification code, received during the device authorization flow.

Mapping:

For OAuth 2.x requests with device_code as grant_type, the assertion of the negotiation client in the mapping (cf. supra) MUST have as value the device_code provided by the request.

2.3.4.5 assertion

The assertion property is defined in RFC 7521 as required when using assertions as authorization grants, with the grant_type property indicating its serialization. Its value is the assertion provided as authorization grant, in the indicated serialization. In particular, in RFC 7523, the grant_type needs to be urn:ietf:params:oauth:grant-type:jwt-bearer, with the assertion being a JSON Web Token (JWT).

Mapping:

For OAuth 2.x requests containing an assertion property, the assertion of the negotiation client in the mapping (cf. supra) MUST have as value the assertion provided by the request.

2.3.5 client_assertion & client_assertion_type

The client_assertion and client_assertion_type properties are defined in RFC 7521 as required when using assertions for client authentication. The value of the former is an assertion provided as client authentication; the value of the latter is an absolute URI, indicating the former's serialization. In particular, in RFC 7523, the client_assertion_type needs to be urn:ietf:params:oauth:grant-type:jwt-bearer, in which case the value of client_assertion needs to be a JSON Web Token (JWT).

Mapping:

For OAuth 2.x requests containing the client_assertion and client_assertion_type properties, an additional assertion MUST be added to the negotiation client in the mapping MUST have as value the value of the former, and as class the value of the latter.

2.3.6 subject_token & subject_token_type

The subject_token and subject_token_type properties are defined in RFC 8693 as required. The value of the former is a token that represents the identity of the subject party -- on whose behalf the authorization request is being made, an on whose behalf the requested token will be used; the value of the latter is a URI, indicating the serialization of the former.

Mapping:

For OAuth 2.x requests containing the subject_token and subject_token_type properties, the consumer of each rule in its mapping MUST contain an assertion, the value of which is the value of the former, and the class of which the value of the latter.

2.3.7 actor_token & actor_token_type

The actor_token and actor_token_type properties are defined in RFC 8693 as optional. The value of the former is a token that represents the identity of the acting party -- who will be authorized to use the requested token to act on behalf of the subject; the value of the latter is a URI, indicating the serialization of the former.

Mapping:

For OAuth 2.x requests containing the actor_token and actor_token_type properties, the consumer of each rule in its mapping MUST contain an assertion, the value of which is the value of the former, and the class of which the value of the latter.

Footnotes

  1. It is required by the OAuth Identity and Authorization Chaining (draft) when no audience property is present↩︎

  2. In RFC 7521 (Assertion Framework for OAuth 2.0), for example, the property is unnecessary when the client is already identified by the subject of an assertion; if present, both properties must identify the same client. To contrast, in the OAuth Client ID Metadata Document (draft), the property is always required.↩︎

  3. For RFC 9101 (OAuth 2.0 JWT-secured Authorization Request), the value must match the request object's client_id parameter. In the OAuth Client ID Metadata Document (draft), its value must be a URL.↩︎

  4. It is also required for OAuth 2.1 (draft).↩︎

  5. Importantly, it is required to be present with a value different than plain for OAuth 2.1 (draft).↩︎

  6. It is a required parameter for the RFC 7521 model (Identity Assertion JWT Authorization Grant). It is also required for Oauth 2.0 Transaction Tokens (draft), and for OAuth 2.0 Identity Chaining (draft) if the resource property is not present.↩︎

  7. Importantly, in OAuth 2.1 (draft), it is deprecated in favor of PKCE.↩︎

  8. It is also required for OAuth 2.1 (draft).↩︎

  9. One exception to this is RFC 9201, for which the parameter is optional, and falls back to client_credentials as a default value.↩︎