Generalized Policy Management profile for the Grant Negotiation and Authorization Protocol
1 Introduction
This section is not normative.
This document provides a mapping profile for Generalized Policy Management (GPM), targeting the IETF's Grant Negotiation and Authorization Protocol (GNAP). In particular, it maps parameters of the following specifications on the GPM model.
- RFC 9635 (Grant Negotiation and Authorization Protocol)
- RFC 9767 (GNAP Resource Server Connections)
2 Mapping GNAP to GPM
The GNAP framework defines request parameters for several sequences for requesting and negotiation authorization. This document specifies GPM mappings for the GNAP authorization request at the grant endpoint of the AS. These requests are JSON objects consisting of five different blocks (top-level properties):
client, always required ([@map-client]);subject, required when requesting subject information ([@map-subject]);access_token, required when requesting an access token ([@map-token]);interact, required if interaction is supported ([@map-interact]); anduser, optional ([@map-user]);
The following subsections map each of these blocks, resulting in one or more Policies, which MUST only contain authorization Rules.
2.1 Access token
The access_token block of a GNAP authorization request is a JSON object or an array of objects, which describe authorization requirements for which a resulting token is expected. Each such object MUST be mapped to a single Policy that contains the Rules generated by its parameters.
GNAP defines the following properties that can occur in an access token object.
2.1.1 access
The access property is required to obtain an access token. Its value is either a JSON object conforming to the structure of the authorization_details property of RFC9396 (OAuth 2.0 Rich Authorization Requests); or a JSON array, consisting of such objects, or strings, or both.
Mapping:
These objects MUST be processed in accordance with the GPM profile for OAuth 2.x. In the case of strings, the elements need to be interpreted as authorization details objects with the string's value as type, and no other explicit fields, which must be processed in the same way.
2.1.2 label
The label property is required as soon as multiple tokens are requested. Its value is a client-defined unique string handle for the corresponding resulting access token.
Mapping:
The identifier of each Policy MUST be set to the value of the label property of the corresponding access_token object -- prefixed with the client identifier if the value is not a valid IRI. If the request consists of a single Policy, and no label is given, an identifier SHOULD be minted.
2.1.3 flags
The flags property is optional. Its value is an array of strings, which represent attributes or behavior required of the corresponding access token.
Mapping:
For each string in the flags array of an access_token object, a class MUST be added to the corresponding Policy, prefixed with urn:example:gpm:fallback: if the string is not a valid IRI.
2.2 Client
The client block is required. Its value is either a string or a JSON object, which describes the client application (instance) that is making the authorization request.
Mapping:
If the value of the
clientproperty of a GNAP request is a string, it MUST be used to identify a previously registered client instance. If this identification succeeds, the client of the request's mapping MUST be the identified instance. Otherwise, the request MUST fail.If the value of the
clientproperty of a GNAP request is a JSON object, its properties MUST be mapped according to the following subsections, and a fresh, unique identifier MUST be assigned to the client of the recipient in the request's mapping.
2.2.1 key
The key property is required. Its value is either a key object, or a string referencing one, which represents the public key that the client will use during this interaction. The key object contains the following fields.
Mapping:
The key of the client of the recipient in the mapping of a GNAP request MUST be the key identified by the value of the request's key property.
2.2.1.1 proof
The proof field is required. Its value is a string or object, representing the form of proof for which the client instance will use the key.
GNAP defines the following methods:
httpsig(string or object) for HTTP message signing;mtls(string) for MTLS certificate verification;jwsd(string) for detached JWS signature headers;jws(string) for attached JWS Payloads.
Mapping:
The usage of the key in the mapping of a GNAP request MUST be the value of the proof field of the request's client block, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.
2.2.1.2 jwk
The jwk field is optional. Its value is a JSON object, representing the public key as a JSON Web Key (JWK), the alg value of which cannot be none.
Mapping:
If the key property of a GNAP request's client block contains a jwk field, the corresponding key in the request's mapping MUST contain a jwk, the value of which is that of the field.
2.2.1.3 cert
The cert field is optional. Its value is a string, representing the certificate used to sign the request, serialized as a Privacy-Enhanced Mail (PEM) value with optional header, footer, and internal whitespace.
Mapping:
If the key property of a GNAP request's client block contains a cert field, the corresponding key in the request's mapping MUST contain a certificate, the value of which is that of the field's.
2.2.1.4 cert#S256
The cert#S256 field is optional. Its value is a string, representing the thumbprint of certificate used to sign the request, serialized per MTLS for OAuth (RFC 8705), in base64url encoding.
Mapping:
If the key property of a GNAP request's client block contains a cert#S256 field, the corresponding key in the request's mapping MUST contain a thumbprint, the value of which is that of the field's.
2.3 User
The user block is optional. Its value is either a string or a JSON object, which identifies the end-user of this interaction in a verifiable way. As an object, it can include the following properties.
2.3.1 sub_ids
The sub_ids property is optional. Its value is an array of JSON objects, representing the [RFC 9493] Subject Identifier(s) of the end user.
Mapping:
If a GNAP request contains a user block with a sub_ids array, then for each of its elements, the recipient of the mapping's negotiate block MUST have an identifier that has the value of the element's format field as class, and the element's remaining properties as additional parameters.
2.3.2 assertions
The assertions property is optional. Its value is an array of JSON objects, representing (verifiable) assertions about the end-user, as pairs of format and value fields, of which the latter is a representation of the assertion -- serialized as a JSON string -- and the former a string that indicates the representation's structure.
Mapping:
If a GNAP request contains a user block with an assertions array, then for each of its elements, the recipient of the mapping's negotiate block MUST have an assertion that has the value of the element's format field as datatype, and the element's value as literal value.
2.4 Interact
The interact block is required if interaction is supported. Its value is a JSON object, which describes the interaction modes supported by the client application. It can include the following properties.
2.4.1 start
The start property is required. Its value is a JSON array of strings, objects, or both, which indicate the modes and parameters supported by the client application to start the interaction. It includes the following field, which in turn determines which additional parameters are needed (if any).
Mapping:
The start property of a GNAP request MUST be mapped according to the following subsections.
2.4.1.1 mode
The mode field is required. Its value is a string, representing one of the modes supported by the client application to start an interaction.
The GNAP specification defines the following start modes: redirect, app, user_code, user_code_uri.
Mapping:
The negotiate object in the mapping of a GNAP request MUST contain the value of the mode field as interaction method, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI.
2.4.2 finish
The finish property is optional. Its value is a JSON object, indicating the mode and parameters supported by the client application to receive an indication that interaction has finished. It includes the following fields.
Mapping:
If the interact block of a GNAP request contains the finish property, its fields MUST be mapped according to the following subsections.
2.4.2.1 method
The method field is required. Its value is a string, indicating the callback method the client application supports.
The GNAP specification defines the following methods: redirect, push.
Mapping:
The negotiate object in the mapping of a GNAP request MUST contain the value of the method field as notification method, prefixed with urn:example:gpm:fallback: if the value is not a valid IRI
2.4.2.2 uri
The uri field is required if the method is redirect or push. Its value is a string that is an absolute URI without a fragment component, which the AS will use to signal the client instance that interaction has finished.
Mapping:
The negotiate object in the mapping of a GNAP request MUST contain the value of the uri field as notification uri.
2.4.2.3 nonce
The nonce field is required. Its value is a string of ASCII characters that is unique and unguessable within the context of the AS, which will be used to calculate the hash parameter used in the callback.
Mapping:
The negotiate object in the mapping of a GNAP request MUST contain the value of the nonce field as nonce.
2.4.2.4 hash_method
The hash_method field is optional. Its value is a string, representing the hash mechanism expected to calculate the callback hash.
The GNAP specification defines the default value to be sha-256.
Mapping:
If the interact object of a GNAP request contains the hash_method field, the negotiate object in the request's mapping MUST contain the field's value as hash algorithm.