draft-ietf-gnap-core-protocol-01.txt   draft-ietf-gnap-core-protocol-02.txt 
GNAP J. Richer, Ed. GNAP J. Richer, Ed.
Internet-Draft Bespoke Engineering Internet-Draft Bespoke Engineering
Intended status: Standards Track A. Parecki Intended status: Standards Track A. Parecki
Expires: 6 May 2021 Okta Expires: 21 May 2021 Okta
F. Imbault F. Imbault
acert.io acert.io
2 November 2020 17 November 2020
Grant Negotiation and Authorization Protocol Grant Negotiation and Authorization Protocol
draft-ietf-gnap-core-protocol-01 draft-ietf-gnap-core-protocol-02
Abstract Abstract
This document defines a mechanism for delegating authorization to a This document defines a mechanism for delegating authorization to a
piece of software, and conveying that delegation to the software. piece of software, and conveying that delegation to the software.
This delegation can include access to a set of APIs as well as This delegation can include access to a set of APIs as well as
information passed directly to the software. information passed directly to the software.
This document has been prepared by the GNAP working group design team This document has been prepared by the GNAP working group design team
of Kathleen Moriarty, Fabien Imbault, Dick Hardt, Mike Jones, and of Kathleen Moriarty, Fabien Imbault, Dick Hardt, Mike Jones, and
skipping to change at page 1, line 45 skipping to change at page 1, line 45
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 6 May 2021. This Internet-Draft will expire on 21 May 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5
1.2. Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2. Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3. Elements . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3. Elements . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4. Sequences . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4. Sequences . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.1. Redirect-based Interaction . . . . . . . . . . . . . 10 1.4.1. Redirect-based Interaction . . . . . . . . . . . . . 10
1.4.2. User-code Interaction . . . . . . . . . . . . . . . . 12 1.4.2. User-code Interaction . . . . . . . . . . . . . . . . 12
1.4.3. Asynchronous Authorization . . . . . . . . . . . . . 14 1.4.3. Asynchronous Authorization . . . . . . . . . . . . . 14
1.4.4. Software-only Authorization . . . . . . . . . . . . . 16 1.4.4. Software-only Authorization . . . . . . . . . . . . . 15
1.4.5. Refreshing an Expired Access Token . . . . . . . . . 16 1.4.5. Refreshing an Expired Access Token . . . . . . . . . 16
2. Requesting Access . . . . . . . . . . . . . . . . . . . . . . 17 2. Requesting Access . . . . . . . . . . . . . . . . . . . . . . 17
2.1. Requesting Resources . . . . . . . . . . . . . . . . . . 19 2.1. Requesting Resources . . . . . . . . . . . . . . . . . . 19
2.1.1. Requesting a Single Access Token . . . . . . . . . . 20 2.1.1. Requesting a Single Access Token . . . . . . . . . . 19
2.1.2. Requesting Resources By Reference . . . . . . . . . . 21 2.1.2. Requesting Resources By Reference . . . . . . . . . . 21
2.1.3. Requesting Multiple Access Tokens . . . . . . . . . . 23 2.1.3. Requesting Multiple Access Tokens . . . . . . . . . . 23
2.1.4. Signaling Token Behavior . . . . . . . . . . . . . . 25 2.1.4. Signaling Token Behavior . . . . . . . . . . . . . . 25
2.2. Requesting User Information . . . . . . . . . . . . . . . 27 2.2. Requesting User Information . . . . . . . . . . . . . . . 26
2.3. Identifying the RC . . . . . . . . . . . . . . . . . . . 28 2.3. Identifying the RC . . . . . . . . . . . . . . . . . . . 27
2.3.1. Identifying the RC Instance . . . . . . . . . . . . . 30 2.3.1. Identifying the RC Instance . . . . . . . . . . . . . 29
2.3.2. Identifying the RC Key . . . . . . . . . . . . . . . 31 2.3.2. Identifying the RC Key . . . . . . . . . . . . . . . 30
2.3.3. Providing Displayable RC Information . . . . . . . . 32 2.3.3. Providing Displayable RC Information . . . . . . . . 31
2.3.4. Authenticating the RC . . . . . . . . . . . . . . . . 33 2.3.4. Authenticating the RC . . . . . . . . . . . . . . . . 31
2.4. Identifying the User . . . . . . . . . . . . . . . . . . 33 2.4. Identifying the User . . . . . . . . . . . . . . . . . . 32
2.4.1. Identifying the User by Reference . . . . . . . . . . 34 2.4.1. Identifying the User by Reference . . . . . . . . . . 33
2.5. Interacting with the User . . . . . . . . . . . . . . . . 35 2.5. Interacting with the User . . . . . . . . . . . . . . . . 33
2.5.1. Redirect to an Arbitrary URL . . . . . . . . . . . . 37 2.5.1. Redirect to an Arbitrary URL . . . . . . . . . . . . 35
2.5.2. Open an Application-specific URL . . . . . . . . . . 37 2.5.2. Open an Application-specific URL . . . . . . . . . . 36
2.5.3. Receive a Callback After Interaction . . . . . . . . 38 2.5.3. Receive a Callback After Interaction . . . . . . . . 36
2.5.4. Display a Short User Code . . . . . . . . . . . . . . 42 2.5.4. Display a Short User Code . . . . . . . . . . . . . . 38
2.5.5. Indicate Desired Interaction Locales . . . . . . . . 42 2.5.5. Indicate Desired Interaction Locales . . . . . . . . 38
2.5.6. Extending Interaction Modes . . . . . . . . . . . . . 42 2.5.6. Extending Interaction Modes . . . . . . . . . . . . . 39
2.6. Declaring RC Capabilities . . . . . . . . . . . . . . . . 43 2.6. Declaring RC Capabilities . . . . . . . . . . . . . . . . 39
2.7. Referencing an Existing Grant Request . . . . . . . . . . 43 2.7. Referencing an Existing Grant Request . . . . . . . . . . 39
2.8. Requesting OpenID Connect Claims . . . . . . . . . . . . 43 2.8. Requesting OpenID Connect Claims . . . . . . . . . . . . 39
2.9. Extending The Grant Request . . . . . . . . . . . . . . . 44 2.9. Extending The Grant Request . . . . . . . . . . . . . . . 40
3. Grant Response . . . . . . . . . . . . . . . . . . . . . . . 45 3. Grant Response . . . . . . . . . . . . . . . . . . . . . . . 40
3.1. Request Continuation . . . . . . . . . . . . . . . . . . 46 3.1. Request Continuation . . . . . . . . . . . . . . . . . . 42
3.2. Access Tokens . . . . . . . . . . . . . . . . . . . . . . 47 3.2. Access Tokens . . . . . . . . . . . . . . . . . . . . . . 43
3.2.1. Single Access Token . . . . . . . . . . . . . . . . . 48 3.2.1. Single Access Token . . . . . . . . . . . . . . . . . 43
3.2.2. Multiple Access Tokens . . . . . . . . . . . . . . . 50 3.2.2. Multiple Access Tokens . . . . . . . . . . . . . . . 46
3.3. Interaction Modes . . . . . . . . . . . . . . . . . . . . 51 3.3. Interaction Modes . . . . . . . . . . . . . . . . . . . . 47
3.3.1. Redirection to an arbitrary URL . . . . . . . . . . . 51 3.3.1. Redirection to an arbitrary URL . . . . . . . . . . . 47
3.3.2. Launch of an application URL . . . . . . . . . . . . 52 3.3.2. Launch of an application URL . . . . . . . . . . . . 48
3.3.3. Post-interaction Callback to an RC URL . . . . . . . 52 3.3.3. Post-interaction Callback to an RC URL . . . . . . . 48
3.3.4. Display of a Short User Code . . . . . . . . . . . . 53 3.3.4. Display of a Short User Code . . . . . . . . . . . . 49
3.3.5. Extending Interaction Mode Responses . . . . . . . . 54 3.3.5. Extending Interaction Mode Responses . . . . . . . . 50
3.4. Returning User Information . . . . . . . . . . . . . . . 54 3.4. Returning User Information . . . . . . . . . . . . . . . 50
3.5. Returning Dynamically-bound Reference Handles . . . . . . 56 3.5. Returning Dynamically-bound Reference Handles . . . . . . 51
3.6. Error Response . . . . . . . . . . . . . . . . . . . . . 58 3.6. Error Response . . . . . . . . . . . . . . . . . . . . . 53
3.7. Extending the Response . . . . . . . . . . . . . . . . . 58 3.7. Extending the Response . . . . . . . . . . . . . . . . . 53
4. Interaction at the AS . . . . . . . . . . . . . . . . . . . . 58 4. Interaction at the AS . . . . . . . . . . . . . . . . . . . . 53
4.1. Interaction at a Redirected URI . . . . . . . . . . . . . 59 4.1. Interaction at a Redirected URI . . . . . . . . . . . . . 54
4.2. Interaction at the User Code URI . . . . . . . . . . . . 59 4.2. Interaction at the User Code URI . . . . . . . . . . . . 54
4.3. Interaction through an Application URI . . . . . . . . . 60 4.3. Interaction through an Application URI . . . . . . . . . 55
4.4. Post-Interaction Completion . . . . . . . . . . . . . . . 60 4.4. Post-Interaction Completion . . . . . . . . . . . . . . . 55
4.4.1. Completing Interaction with a Browser Redirect to the 4.4.1. Completing Interaction with a Browser Redirect to the
Callback URI . . . . . . . . . . . . . . . . . . . . 61 Callback URI . . . . . . . . . . . . . . . . . . . . 56
4.4.2. Completing Interaction with a Direct HTTP Request 4.4.2. Completing Interaction with a Direct HTTP Request
Callback . . . . . . . . . . . . . . . . . . . . . . 62 Callback . . . . . . . . . . . . . . . . . . . . . . 56
4.4.3. Calculating the interaction hash . . . . . . . . . . 62 4.4.3. Calculating the interaction hash . . . . . . . . . . 57
5. Continuing a Grant Request . . . . . . . . . . . . . . . . . 64 5. Continuing a Grant Request . . . . . . . . . . . . . . . . . 58
5.1. Continuing After a Completed Interaction . . . . . . . . 66 5.1. Continuing After a Completed Interaction . . . . . . . . 60
5.2. Continuing During Pending Interaction . . . . . . . . . . 67 5.2. Continuing During Pending Interaction . . . . . . . . . . 61
5.3. Modifying an Existing Request . . . . . . . . . . . . . . 69 5.3. Modifying an Existing Request . . . . . . . . . . . . . . 62
5.4. Getting the Current State of a Grant Request . . . . . . 74 5.4. Getting the Current State of a Grant Request . . . . . . 67
5.5. Canceling a Grant Request . . . . . . . . . . . . . . . . 75 5.5. Canceling a Grant Request . . . . . . . . . . . . . . . . 68
6. Token Management . . . . . . . . . . . . . . . . . . . . . . 75 6. Token Management . . . . . . . . . . . . . . . . . . . . . . 68
6.1. Rotating the Access Token . . . . . . . . . . . . . . . . 76 6.1. Rotating the Access Token . . . . . . . . . . . . . . . . 69
6.2. Revoking the Access Token . . . . . . . . . . . . . . . . 78 6.2. Revoking the Access Token . . . . . . . . . . . . . . . . 70
7. Using Access Tokens . . . . . . . . . . . . . . . . . . . . . 79 7. Using Access Tokens . . . . . . . . . . . . . . . . . . . . . 71
8. Binding Keys . . . . . . . . . . . . . . . . . . . . . . . . 80 8. Binding Keys . . . . . . . . . . . . . . . . . . . . . . . . 72
8.1. Detached JWS . . . . . . . . . . . . . . . . . . . . . . 81 8.1. Detached JWS . . . . . . . . . . . . . . . . . . . . . . 73
8.2. Attached JWS . . . . . . . . . . . . . . . . . . . . . . 84 8.2. Attached JWS . . . . . . . . . . . . . . . . . . . . . . 75
8.3. Mutual TLS . . . . . . . . . . . . . . . . . . . . . . . 89 8.3. Mutual TLS . . . . . . . . . . . . . . . . . . . . . . . 79
8.4. Demonstration of Proof-of-Possession (DPoP) . . . . . . . 91 8.4. Demonstration of Proof-of-Possession (DPoP) . . . . . . . 81
8.5. HTTP Signing . . . . . . . . . . . . . . . . . . . . . . 92 8.5. HTTP Signing . . . . . . . . . . . . . . . . . . . . . . 82
8.6. OAuth Proof of Possession (PoP) . . . . . . . . . . . . . 93 8.6. OAuth Proof of Possession (PoP) . . . . . . . . . . . . . 83
9. Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . 95 9. Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10. Resource Servers . . . . . . . . . . . . . . . . . . . . . . 96 10. Resource Servers . . . . . . . . . . . . . . . . . . . . . . 86
10.1. Introspecting a Token . . . . . . . . . . . . . . . . . 97 10.1. Introspecting a Token . . . . . . . . . . . . . . . . . 86
10.2. Deriving a downstream token . . . . . . . . . . . . . . 98 10.2. Deriving a downstream token . . . . . . . . . . . . . . 88
10.3. Registering a Resource Handle . . . . . . . . . . . . . 100 10.3. Registering a Resource Handle . . . . . . . . . . . . . 89
10.4. Requesting a Resources With Insufficient Access . . . . 101 10.4. Requesting Resources With Insufficient Access . . . . . 91
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 101 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 91
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 102 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
13. Security Considerations . . . . . . . . . . . . . . . . . . . 102 13. Security Considerations . . . . . . . . . . . . . . . . . . . 92
14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 102 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 92
15. Normative References . . . . . . . . . . . . . . . . . . . . 102 15. Normative References . . . . . . . . . . . . . . . . . . . . 92
Appendix A. Document History . . . . . . . . . . . . . . . . . . 104 Appendix A. Document History . . . . . . . . . . . . . . . . . . 94
Appendix B. Component Data Models . . . . . . . . . . . . . . . 105 Appendix B. Component Data Models . . . . . . . . . . . . . . . 94
Appendix C. Example Protocol Flows . . . . . . . . . . . . . . . 105 Appendix C. Example Protocol Flows . . . . . . . . . . . . . . . 95
C.1. Redirect-Based User Interaction . . . . . . . . . . . . . 105 C.1. Redirect-Based User Interaction . . . . . . . . . . . . . 95
C.2. Secondary Device Interaction . . . . . . . . . . . . . . 109 C.2. Secondary Device Interaction . . . . . . . . . . . . . . 99
Appendix D. No User Involvement . . . . . . . . . . . . . . . . 112 Appendix D. No User Involvement . . . . . . . . . . . . . . . . 102
D.1. Asynchronous Authorization . . . . . . . . . . . . . . . 113 D.1. Asynchronous Authorization . . . . . . . . . . . . . . . 103
D.2. Applying OAuth 2 Scopes and Client IDs . . . . . . . . . 116 D.2. Applying OAuth 2 Scopes and Client IDs . . . . . . . . . 106
Appendix E. JSON Structures and Polymorphism . . . . . . . . . . 117 Appendix E. JSON Structures and Polymorphism . . . . . . . . . . 107
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 118 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 108
1. Introduction 1. Introduction
This protocol allows a piece of software, the resource client, to This protocol allows a piece of software, the resource client, to
request delegated authorization to resource servers and direct request delegated authorization to resource servers and to request
information. This delegation is facilitated by an authorization direct information. This delegation is facilitated by an
server usually on behalf of a resource owner. The requesting party authorization server usually on behalf of a resource owner. The
operating the software may interact with the authorization server to requesting party operating the software may interact with the
authenticate, provide consent, and authorize the request. authorization server to authenticate, provide consent, and authorize
the request.
The process by which the delegation happens is known as a grant, and The process by which the delegation happens is known as a grant, and
the GNAP protocol allows for the negotiation of the grant process GNAP allows for the negotiation of the grant process over time by
over time by multiple parties acting in distinct roles. multiple parties acting in distinct roles.
This protocol solves many of the same use cases as OAuth 2.0 This protocol solves many of the same use cases as OAuth 2.0
[RFC6749], OpenID Connect [OIDC], and the family of protocols that [RFC6749], OpenID Connect [OIDC], and the family of protocols that
have grown up around that ecosystem. However, GNAP is not an have grown up around that ecosystem. However, GNAP is not an
extension of OAuth 2.0 and is not intended to be directly compatible extension of OAuth 2.0 and is not intended to be directly compatible
with OAuth 2.0. GNAP seeks to provide functionality and solve use with OAuth 2.0. GNAP seeks to provide functionality and solve use
cases that OAuth 2.0 cannot easily or cleanly address. Even so, GNAP cases that OAuth 2.0 cannot easily or cleanly address. Even so, GNAP
and OAuth 2.0 will exist in parallel for many deployments, and and OAuth 2.0 will exist in parallel for many deployments, and
considerations have been taken to facilitate the mapping and considerations have been taken to facilitate the mapping and
transition from legacy systems to GNAP. Some examples of these can transition from legacy systems to GNAP. Some examples of these can
skipping to change at page 5, line 15 skipping to change at page 5, line 15
1.1. Terminology 1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
1.2. Roles 1.2. Roles
The parties in the GNAP protocol perform actions under different The parties in GNAP perform actions under different roles. Roles are
roles. Roles are defined by the actions taken and the expectations defined by the actions taken and the expectations leveraged on the
leveraged on the role by the overall protocol. role by the overall protocol.
Authorization Server (AS) Manages the requested delegations for the Authorization Server (AS) Manages the requested delegations for the
RO. The AS issues tokens and directly delegated information to RO. The AS issues tokens and directly delegated information to
the RC. The AS is defined by its grant endpoint, a single URL the RC. The AS is defined by its grant endpoint, a single URL
that accepts a POST request with a JSON payload. The AS could that accepts a POST request with a JSON payload. The AS could
also have other endpoints, including interaction endpoints and also have other endpoints, including interaction endpoints and
user code endpoints, and these are introduced to the RC as needed user code endpoints, and these are introduced to the RC as needed
during the delegation process. during the delegation process.
Resource Client (RC, aka "client") Requests tokens from the AS and Resource Client (RC, aka "client") Requests tokens from the AS and
skipping to change at page 5, line 43 skipping to change at page 5, line 43
Resource Server (RS, aka "API") Accepts tokens from the RC issued by Resource Server (RS, aka "API") Accepts tokens from the RC issued by
the AS and serves delegated resources on behalf of the RO. There the AS and serves delegated resources on behalf of the RO. There
could be multiple RSs protected by the AS that the RC will call. could be multiple RSs protected by the AS that the RC will call.
Resource Owner (RO) Authorizes the request from the RC to the RS, Resource Owner (RO) Authorizes the request from the RC to the RS,
often interactively at the AS. often interactively at the AS.
Requesting Party (RQ, aka "user") Operates and interacts with the Requesting Party (RQ, aka "user") Operates and interacts with the
RC. RC.
The GNAP protocol design does not assume any one deployment The design of GNAP does not assume any one deployment architecture,
architecture, but instead attempts to define roles that can be but instead attempts to define roles that can be fulfilled in a
fulfilled in a number of different ways for different use cases. As number of different ways for different use cases. As long as a given
long as a given role fulfills all of its obligations and behaviors as role fulfills all of its obligations and behaviors as defined by the
defined by the protocol, GNAP does not make additional requirements protocol, GNAP does not make additional requirements on its structure
on its structure or setup. or setup.
Multiple roles can be fulfilled by the same party, and a given party Multiple roles can be fulfilled by the same party, and a given party
can switch roles in different instances of the protocol. For can switch roles in different instances of the protocol. For
example, the RO and RQ in many instances are the same person, where a example, the RO and RQ in many instances are the same person, where a
user is authorizing the RC to act on their own behalf at the RS. In user is authorizing the RC to act on their own behalf at the RS. In
this case, one party fulfills both of the RO and RQ roles, but the this case, one party fulfills both of the RO and RQ roles, but the
roles themselves are still defined separately from each other to roles themselves are still defined separately from each other to
allow for other use cases where they are fulfilled by different allow for other use cases where they are fulfilled by different
parties. parties.
skipping to change at page 6, line 35 skipping to change at page 6, line 35
that the RC calls directly could be different from the component that that the RC calls directly could be different from the component that
the the RO interacts with to drive consent, since API calls and user the the RO interacts with to drive consent, since API calls and user
interaction have different security considerations in many interaction have different security considerations in many
environments. Furthermore, the AS could need to collect identity environments. Furthermore, the AS could need to collect identity
claims about the RO from one system that deals with user attributes claims about the RO from one system that deals with user attributes
while generating access tokens at another system that deals with while generating access tokens at another system that deals with
security rights. From the perspective of GNAP, all of these are security rights. From the perspective of GNAP, all of these are
pieces of the AS and together fulfill the role of the AS as defined pieces of the AS and together fulfill the role of the AS as defined
by the protocol. by the protocol.
[[ Editor's note: The names for the roles are an area of ongoing [[ See issue #29 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
discussion within the working group, as is the appropriate precision issues/29) ]]
of what activities and expectations a particular role covers. In
particular, the AS might be formally decomposed into delegation
components, that the client talks to, and interaction components,
that the user talks to. Several alternative names have been proposed
for different roles and components, including:
* Grant Server (for Authorization Server)
* Grant Client (for Resource Client)
* Operator (for Requesting Party)
]] [[ See issue #32 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/32) ]]
1.3. Elements 1.3. Elements
In addition to the roles above, the protocol also involves several In addition to the roles above, the protocol also involves several
elements that are acted upon by the roles throughout the process. elements that are acted upon by the roles throughout the process.
Access Token A credential representing a set of access rights Access Token A credential representing a set of access rights
delegated to the RC. The access token is created by the AS, delegated to the RC. The access token is created by the AS,
consumed and verified by the RS, and issued to and carried by the consumed and verified by the RS, and issued to and carried by the
RC. The contents and format of the access token are opaque to the RC. The contents and format of the access token are opaque to the
skipping to change at page 7, line 32 skipping to change at page 7, line 21
Resource A protected API served by the RS and accessed by the RC. Resource A protected API served by the RS and accessed by the RC.
Access to this resource is delegated by the RO as part of the Access to this resource is delegated by the RO as part of the
grant process. grant process.
Subject Information Information about the RO that is returned Subject Information Information about the RO that is returned
directly to the RC from the AS without the RC making a separate directly to the RC from the AS without the RC making a separate
call to an RS. Access to this information is delegated by the RO call to an RS. Access to this information is delegated by the RO
as part of the grant process. as part of the grant process.
[[ Editor's note: What other core elements need an introduction here? [[ See issue #33 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
These aren't roles to be taken on by different parties, nor are they issues/33) ]]
descriptions of the possible configurations of parties, but these are
still important moving parts within the protocol. ]]
1.4. Sequences 1.4. Sequences
The GNAP protocol can be used in a variety of ways to allow the core GNAP can be used in a variety of ways to allow the core delegation
delegation process to take place. Many portions of this process are process to take place. Many portions of this process are
conditionally present depending on the context of the deployments, conditionally present depending on the context of the deployments,
and not every step in this overview will happen in all circumstances. and not every step in this overview will happen in all circumstances.
Note that a connection between roles in this process does not Note that a connection between roles in this process does not
necessarily indicate that a specific protocol message is sent across necessarily indicate that a specific protocol message is sent across
the wire between the components fulfilling the roles in question, or the wire between the components fulfilling the roles in question, or
that a particular step is required every time. For example, for an that a particular step is required every time. For example, for an
RC interested in only getting subject information directly, and not RC interested in only getting subject information directly, and not
calling an RS, all steps involving the RS below do not apply. calling an RS, all steps involving the RS below do not apply.
In some circumstances, the information needed at a given stage is In some circumstances, the information needed at a given stage is
communicated out-of-band or is pre-configured between the components communicated out of band or is preconfigured between the components
or entities performing the roles. For example, one entity can fulfil or entities performing the roles. For example, one entity can fulfil
multiple roles, and so explicit communication between the roles is multiple roles, and so explicit communication between the roles is
not necessary within the protocol flow. not necessary within the protocol flow.
+------------+ +------------+ +------------+ +------------+
| Requesting | ~ ~ ~ ~ ~ ~ | Resource | | Requesting | ~ ~ ~ ~ ~ ~ | Resource |
| Party (RQ) | | Owner (RO) | | Party (RQ) | | Owner (RO) |
+------------+ +------------+ +------------+ +------------+
+ + + +
+ + + +
skipping to change at page 10, line 13 skipping to change at page 9, line 51
* (11) The RC uses the new access token (Section 7) to call the RS. * (11) The RC uses the new access token (Section 7) to call the RS.
* (12) The RS determines if the new token is sufficient for the * (12) The RS determines if the new token is sufficient for the
request by examining the token, potentially calling the AS request by examining the token, potentially calling the AS
(Section 10.1). (Section 10.1).
* (13) The RC disposes of the token (Section 6.2) once the RC has * (13) The RC disposes of the token (Section 6.2) once the RC has
completed its access of the RS and no longer needs the token. completed its access of the RS and no longer needs the token.
The following sections and Appendix C contain specific guidance on The following sections and Appendix C contain specific guidance on
how to use the GNAP protocol in different situations and deployments. how to use GNAP in different situations and deployments.
1.4.1. Redirect-based Interaction 1.4.1. Redirect-based Interaction
In this example flow, the RC is a web application that wants access In this example flow, the RC is a web application that wants access
to resources on behalf of the current user, who acts as both the to resources on behalf of the current user, who acts as both the
requesting party (RQ) and the resource owner (RO). Since the RC is requesting party (RQ) and the resource owner (RO). Since the RC is
capable of directing the user to an arbitrary URL and receiving capable of directing the user to an arbitrary URL and receiving
responses from the user's browser, interaction here is handled responses from the user's browser, interaction here is handled
through front-channel redirects using the user's browser. The RC through front-channel redirects using the user's browser. The RC
uses a persistent session with the user to ensure the same user that uses a persistent session with the user to ensure the same user that
skipping to change at page 18, line 5 skipping to change at page 17, line 33
can also include updated token management information, which the can also include updated token management information, which the
RC will store in place of the values returned in (2). RC will store in place of the values returned in (2).
2. Requesting Access 2. Requesting Access
To start a request, the RC sends JSON [RFC8259] document with an To start a request, the RC sends JSON [RFC8259] document with an
object as its root. Each member of the request object represents a object as its root. Each member of the request object represents a
different aspect of the RC's request. Each field is described in different aspect of the RC's request. Each field is described in
detail in a section below. detail in a section below.
resources Describes the rights that the RC is requesting for one or resources (object / array of objects/strings) Describes the rights
more access tokens to be used at RS's. Section 2.1 that the RC is requesting for one or more access tokens to be used
at RS's. Section 2.1
subject Describes the information about the RO that the RC is subject (object) Describes the information about the RO that the RC
requesting to be returned directly in the response from the AS. is requesting to be returned directly in the response from the AS.
Section 2.2 Section 2.2
client Describes the RC that is making this request, including the client (object / string) Describes the RC that is making this
key that the RC will use to protect this request and any request, including the key that the RC will use to protect this
continuation requests at the AS and any user-facing information request and any continuation requests at the AS and any user-
about the RC used in interactions at the AS. Section 2.3 facing information about the RC used in interactions at the AS.
Section 2.3
user Identifies the RQ to the AS in a manner that the AS can verify, user (object / string) Identifies the RQ to the AS in a manner that
either directly or by interacting with the RQ to determine their the AS can verify, either directly or by interacting with the RQ
status as the RO. Section 2.4 to determine their status as the RO. Section 2.4
interact Describes the modes that the RC has for allowing the RO to interact (object) Describes the modes that the RC has for allowing
interact with the AS and modes for the RC to receive updates when the RO to interact with the AS and modes for the RC to receive
interaction is complete. Section 2.5 updates when interaction is complete. Section 2.5
capabilities Identifies named extension capabilities that the RC can capabilities (array of strings) Identifies named extension
use, signaling to the AS which extensions it can use. Section 2.6 capabilities that the RC can use, signaling to the AS which
extensions it can use. Section 2.6
existing_grant Identifies a previously-existing grant that the RC is existing_grant (string) Identifies a previously-existing grant that
extending with this request. Section 2.7 the RC is extending with this request. Section 2.7
claims Identifies the identity claims to be returned as part of an claims (object) Identifies the identity claims to be returned as
OpenID Connect claims request. Section 2.8 part of an OpenID Connect claims request. Section 2.8
Additional members of this request object can be defined by Additional members of this request object can be defined by
extensions to this protocol as described in Section 2.9 extensions to this protocol as described in Section 2.9
A non-normative example of a grant request is below: A non-normative example of a grant request is below:
{ {
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
skipping to change at page 19, line 36 skipping to change at page 19, line 20
"interact": { "interact": {
"redirect": true, "redirect": true,
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return/123455", "uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
}, },
"capabilities": ["ext1", "ext2"], "capabilities": ["ext1", "ext2"],
"subject": { "subject": {
"sub_ids": ["iss-sub", "email"], "sub_ids": ["iss_sub", "email"],
"assertions": ["id_token"] "assertions": ["id_token"]
} }
} }
The request MUST be sent as a JSON object in the body of the HTTP The request MUST be sent as a JSON object in the body of the HTTP
POST request with Content-Type "application/json", unless otherwise POST request with Content-Type "application/json", unless otherwise
specified by the signature mechanism. specified by the signature mechanism.
2.1. Requesting Resources 2.1. Requesting Resources
skipping to change at page 20, line 17 skipping to change at page 19, line 49
When requesting an access token, the RC MUST send a "resources" field When requesting an access token, the RC MUST send a "resources" field
containing a JSON array. The elements of the JSON array represent containing a JSON array. The elements of the JSON array represent
rights of access that the RC is requesting in the access token. The rights of access that the RC is requesting in the access token. The
requested access is the sum of all elements within the array. requested access is the sum of all elements within the array.
The RC declares what access it wants to associated with the resulting The RC declares what access it wants to associated with the resulting
access token using objects that describe multiple dimensions of access token using objects that describe multiple dimensions of
access. Each object contains a "type" property that determines the access. Each object contains a "type" property that determines the
type of API that the RC is calling. type of API that the RC is calling.
type The type of resource request as a string. This field MAY type (string) The type of resource request as a string. This field
define which other fields are allowed in the request object. This MAY define which other fields are allowed in the request object.
field is REQUIRED. This field is REQUIRED.
The value of this field is under the control of the AS. This field The value of this field is under the control of the AS. This field
MUST be compared using an exact byte match of the string value MUST be compared using an exact byte match of the string value
against known types by the AS. The AS MUST ensure that there is no against known types by the AS. The AS MUST ensure that there is no
collision between different authorization data types that it collision between different authorization data types that it
supports. The AS MUST NOT do any collation or normalization of data supports. The AS MUST NOT do any collation or normalization of data
types during comparison. It is RECOMMENDED that designers of types during comparison. It is RECOMMENDED that designers of
general-purpose APIs use a URI for this field to avoid collisions general-purpose APIs use a URI for this field to avoid collisions
between multiple API types protected by a single AS. between multiple API types protected by a single AS.
While it is expected that many APIs will have its own properties, a While it is expected that many APIs will have its own properties, a
set of common properties are defined here. Specific API set of common properties are defined here. Specific API
implementations SHOULD NOT re-use these fields with different implementations SHOULD NOT re-use these fields with different
semantics or syntax. The available values for these properties are semantics or syntax. The available values for these properties are
determined by the API being protected at the RS. determined by the API being protected at the RS.
[[ Editor's note: this will align with OAuth 2 RAR, but the details [[ See issue #34 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
of exactly how it aligns are TBD. Since RAR needs to work in the issues/34) ]]
confines of OAuth 2, RAR has to define how to interact with "scope",
"resource", and other existing OAuth 2 mechanisms that don't exist in
GNAP. ]].
actions The types of actions the RC will take at the RS as an array actions (array of strings) The types of actions the RC will take at
of strings. For example, an RC asking for a combination of "read" the RS as an array of strings. For example, an RC asking for a
and "write" access. combination of "read" and "write" access.
locations The location of the RS as an array of strings. These locations (array of strings) The location of the RS as an array of
strings are typically URIs identifying the location of the RS. strings. These strings are typically URIs identifying the
location of the RS.
datatypes The kinds of data available to the RC at the RS's API as datatypes (array of strings) The kinds of data available to the RC
an array of strings. For example, an RC asking for access to raw at the RS's API as an array of strings. For example, an RC asking
"image" data and "metadata" at a photograph API. for access to raw "image" data and "metadata" at a photograph API.
identifier A string identifier indicating a specific resource at the identifier (string) A string identifier indicating a specific
RS. For example, a patient identifier for a medical API or a bank resource at the RS. For example, a patient identifier for a
account number for a financial API. medical API or a bank account number for a financial API.
The following non-normative example shows the use of both common and The following non-normative example shows the use of both common and
API-specific fields as part of two different access "type" values. API-specific fields as part of two different access "type" values.
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
"read", "read",
"write", "write",
skipping to change at page 22, line 5 skipping to change at page 21, line 43
(Section 3.2.1) will include the sum of both of the requested types (Section 3.2.1) will include the sum of both of the requested types
of access. of access.
2.1.2. Requesting Resources By Reference 2.1.2. Requesting Resources By Reference
Instead of sending an object describing the requested resource Instead of sending an object describing the requested resource
(Section 2.1.1), a RC MAY send a string known to the AS or RS (Section 2.1.1), a RC MAY send a string known to the AS or RS
representing the access being requested. Each string SHOULD representing the access being requested. Each string SHOULD
correspond to a specific expanded object representation at the AS. correspond to a specific expanded object representation at the AS.
[[ Editor's note: we could describe more about how the expansion [[ See issue #35 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
would work. For example, expand into an object where the value of issues/35) ]]
the "type" field is the value of the string. Or we could leave it
open and flexible, since it's really up to the AS/RS to interpret. ]]
"resources": [ "resources": [
"read", "dolphin-metadata", "some other thing" "read", "dolphin-metadata", "some other thing"
] ]
This value is opaque to the RC and MAY be any valid JSON string, and This value is opaque to the RC and MAY be any valid JSON string, and
therefore could include spaces, unicode characters, and properly therefore could include spaces, unicode characters, and properly
escaped string sequences. However, in some situations the value is escaped string sequences. However, in some situations the value is
intended to be seen and understood be the RC developer. In such intended to be seen and understood be the RC developer. In such
cases, the API designer choosing any such human-readable strings cases, the API designer choosing any such human-readable strings
skipping to change at page 23, line 35 skipping to change at page 22, line 49
"type": "financial-transaction", "type": "financial-transaction",
"actions": [ "actions": [
"withdraw" "withdraw"
], ],
"identifier": "account-14-32-32-3", "identifier": "account-14-32-32-3",
"currency": "USD" "currency": "USD"
}, },
"some other thing" "some other thing"
] ]
[[ Editor's note: passing resource requests by reference really is [[ See issue #36 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
akin to a "scope", and we have many years of experience showing us issues/36) ]]
that the simplicity of giving a developer a set of strings to send is
a simple and powerful pattern. We could always require objects and
just use the "type" field as a scope value, but that's a lot of
complexity to pay for the simple case. Client developers will always
know which kind they need to send, because they're picking from the
API's documentation. ]]
2.1.3. Requesting Multiple Access Tokens 2.1.3. Requesting Multiple Access Tokens
When requesting multiple access tokens, the resources field is a JSON When requesting multiple access tokens, the resources field is a JSON
object. The names of the JSON object fields are token identifiers object. The names of the JSON object fields are token identifiers
chosen by the RC, and MAY be any valid string. The values of the chosen by the RC, and MAY be any valid string. The values of the
JSON object fields are JSON arrays representing a single access token JSON object fields are JSON arrays representing a single access token
request, as specified in requesting a single access token request, as specified in requesting a single access token
(Section 2.1.1). (Section 2.1.1).
skipping to change at page 25, line 32 skipping to change at page 25, line 32
previous access token. The old access token continues to remain previous access token. The old access token continues to remain
valid until such time as it expires or is revoked through other valid until such time as it expires or is revoked through other
means. means.
split_token The RC is capable of receiving multiple access tokens split_token The RC is capable of receiving multiple access tokens
(Section 3.2.2) in response to any single token request (Section 3.2.2) in response to any single token request
(Section 2.1.1), or receiving a different number of tokens than (Section 2.1.1), or receiving a different number of tokens than
specified in the multiple token request (Section 2.1.3). The specified in the multiple token request (Section 2.1.3). The
labels of the returned additional tokens are chosen by the AS. labels of the returned additional tokens are chosen by the AS.
The RC MUST be able to tell from the token response where and how The RC MUST be able to tell from the token response where and how
it can use each of the access tokens. [[ Editor's note: This it can use each of the access tokens. [[ See issue #37
functionality is controversial at best as it requires (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/37) ]]
significantly more complexity on the client in order to solve one
class of AS/RS deployment choices. ]]
bind_token The RC wants the issued access token to be bound to the bind_token The RC wants the issued access token to be bound to the
key the RC used (Section 2.3.2) to make the request. The key the RC used (Section 2.3.2) to make the request. The
resulting access token MUST be bound using the same "proof" resulting access token MUST be bound using the same "proof"
mechanism used by the client with a "key" value of "true", mechanism used by the client with a "key" value of "true",
indicating the client's presented key is to be used for binding. indicating the client's presented key is to be used for binding.
[[ Editor's note: should there be a different flag and mechanism [[ See issue #38 (https://github.com/ietf-wg-gnap/gnap-core-
for the client to explicitly indicate which binding method it protocol/issues/38) ]]
wants to use, especially if the client wants to use a different
method at the AS than the RS? ]]
The AS MUST respond with any applied flags in the token response The AS MUST respond with any applied flags in the token response
(Section 3.2) "resources" section. (Section 3.2) "resources" section.
In this non-normative example, the requested access token is to be In this non-normative example, the requested access token is to be
bound to the client's key and should be kept during rotation. bound to the client's key and should be kept during rotation.
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
skipping to change at page 26, line 29 skipping to change at page 26, line 29
"images" "images"
] ]
}, },
"read", "read",
"bind_token", "bind_token",
"multi_token" "multi_token"
] ]
Additional flags can be registered in a registry TBD (Section 12). Additional flags can be registered in a registry TBD (Section 12).
[[ Editor's note: while these reference values are "reserved", the [[ See issue #39 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
ultimate decider for what a reference means is the AS, which means an issues/39) ]]
AS could arguably decide that one of these values means something
else. Also, this kind of reservation potentially steps on API
namespaces, which OAuth 2 is careful not to do but common extensions
like OIDC do with their own scope definitions. However, in OIDC,
several "scope" values have behavior similar to what's defined here,
particularly "openid" turns on ID tokens in the response and
"offline_access" signals for the return of a refresh token, and these
can be used outside of OpenID Connect itself. However, to keep these
flags out of the general API namespace, we could use a different
syntax for sending them. In particular, they could be defined under
a GNAP-specific "type" object, where all the flags are fields on the
object.
resources: [
{
type: "gnap-flags",
flag1: true,
flag2: false,
flag3: true ...
},
"reference1",
"scope2", ...
]
Alternatively, all the flags could be sent in an array separate from
the rest of the request.
resources: [
"reference1",
"scope2",
["flag1", "flag2", "flag3"] ...
]
This whole thing might also belong in an extension, as it's advanced
behavior signaling for very specific cases. However, it seems other
extensions would be likely to extend this kind of thing, like OIDC
did with "offline_access". ]]
2.2. Requesting User Information 2.2. Requesting User Information
If the RC is requesting information about the RO from the AS, it If the RC is requesting information about the RO from the AS, it
sends a "subject" field as a JSON object. This object MAY contain sends a "subject" field as a JSON object. This object MAY contain
the following fields (or additional fields defined in a registry TBD the following fields (or additional fields defined in a registry TBD
(Section 12)). (Section 12)).
sub_ids An array of subject identifier subject types requested for sub_ids (array of strings) An array of subject identifier subject
the RO, as defined by [I-D.ietf-secevent-subject-identifiers]. types requested for the RO, as defined by
[I-D.ietf-secevent-subject-identifiers].
assertions An array of requested assertion formats. Possible values assertions (array of strings) An array of requested assertion
include "id_token" for an [OIDC] ID Token and "saml2" for a SAML 2 formats. Possible values include "id_token" for an [OIDC] ID
assertion. Additional assertion values are defined by a registry Token and "saml2" for a SAML 2 assertion. Additional assertion
TBD (Section 12). [[ Editor's note: These values are lifted from values are defined by a registry TBD (Section 12). [[ See issue
[RFC8693]'s "token type identifiers" list, but is there a better #41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41)
source?]] ]]
"subject": { "subject": {
"sub_ids": [ "iss-sub", "email" ], "sub_ids": [ "iss_sub", "email" ],
"assertions": [ "id_token", "saml2" ] "assertions": [ "id_token", "saml2" ]
} }
The AS can determine the RO's identity and permission for releasing The AS can determine the RO's identity and permission for releasing
this information through interaction with the RO (Section 4), AS this information through interaction with the RO (Section 4), AS
policies, or assertions presented by the RC (Section 2.4). If this policies, or assertions presented by the RC (Section 2.4). If this
is determined positively, the AS MAY return the RO's information in is determined positively, the AS MAY return the RO's information in
its response (Section 3.4) as requested. its response (Section 3.4) as requested.
Subject identifiers requested by the RC serve only to identify the RO Subject identifiers requested by the RC serve only to identify the RO
in the context of the AS and can't be used as communication channels in the context of the AS and can't be used as communication channels
by the RC, as discussed in Section 3.4. One method of requesting by the RC, as discussed in Section 3.4. One method of requesting
communication channels and other identity claims are discussed in communication channels and other identity claims are discussed in
skipping to change at page 28, line 19 skipping to change at page 27, line 25
Subject identifiers requested by the RC serve only to identify the RO Subject identifiers requested by the RC serve only to identify the RO
in the context of the AS and can't be used as communication channels in the context of the AS and can't be used as communication channels
by the RC, as discussed in Section 3.4. One method of requesting by the RC, as discussed in Section 3.4. One method of requesting
communication channels and other identity claims are discussed in communication channels and other identity claims are discussed in
Section 2.8. Section 2.8.
The AS SHOULD NOT re-use subject identifiers for multiple different The AS SHOULD NOT re-use subject identifiers for multiple different
ROs. ROs.
[[ Editor's Note: What we're really saying here is that "even if the [[ See issue #42 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
AS gives you an email address to identify the user, that isn't a issues/42) ]]
claim that this is a valid email address for that current user, so
don't try to email them." In order to get a workable email address,
or anything that you can use to contact them, you'd need a full
identity protocol and not just this. Also, subject identifiers are
asserted by the AS and therefore naturally scoped to the AS. Would
changing the name to "as_sub_ids" or "local_sub_ids" help convey that
point? ]]
Note: the "sub_ids" and "assertions" request fields are independent Note: the "sub_ids" and "assertions" request fields are independent
of each other, and a returned assertion MAY omit a requested subject of each other, and a returned assertion MAY omit a requested subject
identifier. identifier.
[[ Editor's note: we're potentially conflating these two types in the [[ See issue #43 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
same structure, so perhaps these should be split. There's also a issues/43) ]]
difference between user information and authentication event
information. ]]
2.3. Identifying the RC 2.3. Identifying the RC
When sending a non-continuation request to the AS, the RC MUST When sending a non-continuation request to the AS, the RC MUST
identify itself by including the "client" field of the request and by identify itself by including the "client" field of the request and by
signing the request as described in Section 8. Note that for a signing the request as described in Section 8. Note that for a
continuation request (Section 5), the RC instance is identified by continuation request (Section 5), the RC instance is identified by
its association with the request being continued and so this field is its association with the request being continued and so this field is
not sent under those circumstances. not sent under those circumstances.
When RC information is sent by value, the "client" field of the When RC information is sent by value, the "client" field of the
request consists of a JSON object with the following fields. request consists of a JSON object with the following fields.
key The public key of the RC to be used in this request as described key (object / string) The public key of the RC to be used in this
in Section 2.3.2. This field is REQUIRED. request as described in Section 2.3.2. This field is REQUIRED.
class_id An identifier string that the AS can use to identify the class_id (string) An identifier string that the AS can use to
software comprising this instance of the RC. The contents and identify the software comprising this instance of the RC. The
format of this field are up to the AS. This field is OPTIONAL. contents and format of this field are up to the AS. This field is
OPTIONAL.
display An object containing additional information that the AS MAY display (object) An object containing additional information that
display to the RO during interaction, authorization, and the AS MAY display to the RO during interaction, authorization,
management. This field is OPTIONAL. and management. This field is OPTIONAL.
"client": { "client": {
"key": { "key": {
"proof": "httpsig", "proof": "httpsig",
"jwk": { "jwk": {
"kty": "RSA", "kty": "RSA",
"e": "AQAB", "e": "AQAB",
"kid": "xyz-1", "kid": "xyz-1",
"alg": "RS256", "alg": "RS256",
"n": "kOB5rR4Jv0GMeLaY6_It_r3ORwdf8ci_JtffXyaSx8xY..." "n": "kOB5rR4Jv0GMeLaY6_It_r3ORwdf8ci_JtffXyaSx8xY..."
skipping to change at page 30, line 5 skipping to change at page 28, line 48
Note that the AS MAY know the RC's public key ahead of time, and the Note that the AS MAY know the RC's public key ahead of time, and the
AS MAY apply different policies to the request depending on what has AS MAY apply different policies to the request depending on what has
been registered against that key. If the same public key is sent by been registered against that key. If the same public key is sent by
value on subsequent access requests, the AS SHOULD treat these value on subsequent access requests, the AS SHOULD treat these
requests as coming from the same RC software instance for purposes of requests as coming from the same RC software instance for purposes of
identification, authentication, and policy application. If the AS identification, authentication, and policy application. If the AS
does not know the RC's public key ahead of time, the AS MAY accept or does not know the RC's public key ahead of time, the AS MAY accept or
reject the request based on AS policy, attestations within the client reject the request based on AS policy, attestations within the client
request, and other mechanisms. request, and other mechanisms.
[[ Editor's note: additional client attestation frameworks will [[ See issue #44 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
eventually need to be addressed here. For example, the organization issues/44) ]]
the client represents, or a family of client software deployed in a
cluster, or the posture of the device the client is installed on.
These all need to be separable from the client's key and potentially
the instance identifier. ]]
2.3.1. Identifying the RC Instance 2.3.1. Identifying the RC Instance
If the RC has an instance identifier that the AS can use to determine If the RC has an instance identifier that the AS can use to determine
appropriate key information, the RC can send this value in the appropriate key information, the RC can send this value in the
"instance_id" field. The instance identifier MAY be assigned to an "instance_id" field. The instance identifier MAY be assigned to an
RC instance at runtime through the Section 3.5 or MAY be obtained in RC instance at runtime through the Section 3.5 or MAY be obtained in
another fashion, such as a static registration process at the AS. another fashion, such as a static registration process at the AS.
instance_id An identifier string that the AS can use to identify the instance_id (string) An identifier string that the AS can use to
particular instance of this RC. The content and structure of this identify the particular instance of this RC. The content and
identifier is opaque to the RC. structure of this identifier is opaque to the RC.
"client": { "client": {
"instance_id": "client-541-ab" "instance_id": "client-541-ab"
} }
If there are no additional fields to send, the RC MAY send the If there are no additional fields to send, the RC MAY send the
instance identifier as a direct reference value in lieu of the instance identifier as a direct reference value in lieu of the
object. object.
"client": "client-541-ab" "client": "client-541-ab"
When the AS receives a request with an instance identifier, the AS When the AS receives a request with an instance identifier, the AS
MUST ensure that the key used to sign the request (Section 8) is MUST ensure that the key used to sign the request (Section 8) is
associated with the instance identifier. associated with the instance identifier.
If the "instance_id" field is sent, it MUST NOT be accompanied by If the "instance_id" field is sent, it MUST NOT be accompanied by
other fields unless such fields are explicitly marked safe for other fields unless such fields are explicitly marked safe for
inclusion alongside the instance identifier. inclusion alongside the instance identifier.
[[ Editor's note: It seems clear that an instance identifier is [[ See issue #45 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
mutually exclusive with most of the fields in the request (eg, we issues/45) ]]
don't want an attacker being able to swap out a client's registered
key just by accessing the identifier). However, some proposed
concepts might fit alongside an instance identifier that change at
runtime, such as device posture or another dynamic attestation.
Should these be sent in the "client" block alongside the instance
identifier, should there be a separate top-level block for runtime
attestations, or some other mechanism? ]]
If the AS does not recognize the instance identifier, the request If the AS does not recognize the instance identifier, the request
MUST be rejected with an error. MUST be rejected with an error.
If the RC instance is identified in this manner, the registered key If the RC instance is identified in this manner, the registered key
for the RC MAY be a symmetric key known to the AS. The RC MUST NOT for the RC MAY be a symmetric key known to the AS. The RC MUST NOT
send a symmetric key by value in the request, as doing so would send a symmetric key by value in the request, as doing so would
expose the key directly instead of proving possession of it. expose the key directly instead of proving possession of it.
[[ Editor's note: In many ways, passing an instance identifier is [[ See issue #46 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
analogous to OAuth 2's "client_id" parameter [RFC6749], especially issues/46) ]]
when coupled with a confidential client's registration and
authentication process. See Appendix D.2 for an example. Something
like this is required to make things easier for client developers in
the common case where the AS already knows the client's key, and to
allow symmetric keys. ]]
2.3.2. Identifying the RC Key 2.3.2. Identifying the RC Key
The RC key MUST be a public key in at least one supported format and The RC key MUST be a public key in at least one supported format and
MUST be applicable to the proofing mechanism used in the request. If MUST be applicable to the proofing mechanism used in the request. If
the key is sent in multiple formats, all the keys MUST be the same. the key is sent in multiple formats, all the keys MUST be the same.
The key presented in this field MUST be the key used to sign the The key presented in this field MUST be the key used to sign the
request. request.
proof The form of proof that the RC will use when presenting the key proof (string) The form of proof that the RC will use when
to the AS. The valid values of this field and the processing presenting the key to the AS. The valid values of this field and
requirements for each are detailed in Section 8. This field is the processing requirements for each are detailed in Section 8.
REQUIRED. This field is REQUIRED.
jwk Value of the public key as a JSON Web Key. MUST contain an "alg" jwk (object) Value of the public key as a JSON Web Key. MUST contain
field which is used to validate the signature. MUST contain the an "alg" field which is used to validate the signature. MUST
"kid" field to identify the key in the signed object. contain the "kid" field to identify the key in the signed object.
cert PEM serialized value of the certificate used to sign the cert (string) PEM serialized value of the certificate used to sign
request, with optional internal whitespace. the request, with optional internal whitespace.
cert#256 The certificate thumbprint calculated as per OAuth-MTLS cert#S256 (string) The certificate thumbprint calculated as per
[RFC8705] in base64 URL encoding. OAuth-MTLS [RFC8705] in base64 URL encoding.
Additional key types are defined in a registry TBD (Section 12). Additional key types are defined in a registry TBD (Section 12).
[[ Editor's note: we will eventually want to have fetchable keys, I [[ See issue #47 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
would guess. Things like DID for key identification are going to be issues/47) ]]
important. ]]
This non-normative example shows a single key presented in multiple This non-normative example shows a single key presented in multiple
formats using a single proofing mechanism. formats using a single proofing mechanism.
"key": { "key": {
"proof": "jwsd", "proof": "jwsd",
"jwk": { "jwk": {
"kty": "RSA", "kty": "RSA",
"e": "AQAB", "e": "AQAB",
"kid": "xyz-1", "kid": "xyz-1",
skipping to change at page 32, line 27 skipping to change at page 31, line 12
Continuation requests (Section 5) MUST use the same key (or its most Continuation requests (Section 5) MUST use the same key (or its most
recent rotation) and proof method as the initial request. recent rotation) and proof method as the initial request.
2.3.3. Providing Displayable RC Information 2.3.3. Providing Displayable RC Information
If the RC has additional information to display to the RO during any If the RC has additional information to display to the RO during any
interactions at the AS, it MAY send that information in the "display" interactions at the AS, it MAY send that information in the "display"
field. This field is a JSON object that declares information to field. This field is a JSON object that declares information to
present to the RO during any interactive sequences. present to the RO during any interactive sequences.
name Display name of the RC software name (string) Display name of the RC software
uri User-facing web page of the RC software uri (string) User-facing web page of the RC software
logo_uri Display image to represent the RC software logo_uri (string) Display image to represent the RC software
"display": { "display": {
"name": "My Client Display Name", "name": "My Client Display Name",
"uri": "https://example.net/client" "uri": "https://example.net/client"
} }
[[ Editor's note: would we want to support pushing a display logo by [[ See issue #48 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
value? On the upside it allows for more dynamic detached clients and issues/48) ]]
doesn't require the AS to fetch information. On the downside, this
is harder for the AS to enforce a policy about and could lead to
potential exploits caused by sending binary image files. ]]
Additional display fields are defined by a registry TBD (Section 12). Additional display fields are defined by a registry TBD (Section 12).
The AS SHOULD use these values during interaction with the RO. The The AS SHOULD use these values during interaction with the RO. The
values are for informational purposes only and MUST NOT be taken as values are for informational purposes only and MUST NOT be taken as
authentic proof of the RC's identity or source. The AS MAY restrict authentic proof of the RC's identity or source. The AS MAY restrict
display values to specific RC instances, as identified by their keys display values to specific RC instances, as identified by their keys
in Section 2.3. in Section 2.3.
2.3.4. Authenticating the RC 2.3.4. Authenticating the RC
skipping to change at page 33, line 39 skipping to change at page 32, line 19
registered RCs can request particular resources, or that all RCs with registered RCs can request particular resources, or that all RCs with
unknown keys have to be interactively approved by an RO. unknown keys have to be interactively approved by an RO.
2.4. Identifying the User 2.4. Identifying the User
If the RC knows the identity of the RQ through one or more If the RC knows the identity of the RQ through one or more
identifiers or assertions, the RC MAY send that information to the AS identifiers or assertions, the RC MAY send that information to the AS
in the "user" field. The RC MAY pass this information by value or by in the "user" field. The RC MAY pass this information by value or by
reference. reference.
sub_ids An array of subject identifiers for the RQ, as defined by sub_ids (array of strings) An array of subject identifiers for the
[I-D.ietf-secevent-subject-identifiers]. RQ, as defined by [I-D.ietf-secevent-subject-identifiers].
assertions An object containing assertions as values keyed on the assertions (object) An object containing assertions as values keyed
assertion type defined by a registry TBD (Section 12). Possible on the assertion type defined by a registry TBD (Section 12).
keys include "id_token" for an [OIDC] ID Token and "saml2" for a Possible keys include "id_token" for an [OIDC] ID Token and
SAML 2 assertion. Additional assertion values are defined by a "saml2" for a SAML 2 assertion. Additional assertion values are
registry TBD (Section 12). [[ Editor's note: These keys are defined by a registry TBD (Section 12). [[ See issue #41
lifted from [RFC8693]'s "token type identifiers" list, but is (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41) ]]
there a better source? Additionally: should this be an array of
objects with internal typing like the sub_ids? Do we expect more
than one assertion per user anyway? ]]
"user": { "user": {
"sub_ids": [ { "sub_ids": [ {
"subject_type": "email", "subject_type": "email",
"email": "user@example.com" "email": "user@example.com"
} ], } ],
"assertions": { "assertions": {
"id_token": "eyj..." "id_token": "eyj..."
} }
} }
Subject identifiers are hints to the AS in determining the RO and Subject identifiers are hints to the AS in determining the RO and
MUST NOT be taken as declarative statements that a particular RO is MUST NOT be taken as declarative statements that a particular RO is
present at the RC and acting as the RQ. Assertions SHOULD be present at the RC and acting as the RQ. Assertions SHOULD be
validated by the AS. [[ editor's note: is this a MUST? Assertion validated by the AS. [[ See issue #49 (https://github.com/ietf-wg-
validation is extremely specific to the kind of assertion in place, gnap/gnap-core-protocol/issues/49) ]]
what other guidance and requirements can we put in place here? ]]
If the identified RQ does not match the RO present at the AS during If the identified RQ does not match the RO present at the AS during
an interaction step, the AS SHOULD reject the request with an error. an interaction step, the AS SHOULD reject the request with an error.
[[ Editor's note: we're potentially conflating identification [[ See issue #50 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
(sub_ids) and provable presence (assertions and a trusted reference issues/50) ]]
handle) in the same structure, so perhaps these should be split. The
security parameters are pretty different here. ]]
If the AS trusts the RC to present verifiable assertions, the AS MAY If the AS trusts the RC to present verifiable assertions, the AS MAY
decide, based on its policy, to skip interaction with the RO, even if decide, based on its policy, to skip interaction with the RO, even if
the RC provides one or more interaction modes in its request. the RC provides one or more interaction modes in its request.
2.4.1. Identifying the User by Reference 2.4.1. Identifying the User by Reference
User reference identifiers can be dynamically issued by the AS User reference identifiers can be dynamically issued by the AS
(Section 3.5) to allow the RC to represent the same RQ to the AS over (Section 3.5) to allow the RC to represent the same RQ to the AS over
subsequent requests. subsequent requests.
If the RC has a reference for the RQ at this AS, the RC MAY pass that If the RC has a reference for the RQ at this AS, the RC MAY pass that
reference as a string. The format of this string is opaque to the reference as a string. The format of this string is opaque to the
RC. RC.
"user": "XUT2MFM1XBIKJKSDU8QM" "user": "XUT2MFM1XBIKJKSDU8QM"
User reference identifiers are not intended to be human-readable user User reference identifiers are not intended to be human-readable user
identifiers or structured assertions. For the RC to send either of identifiers or structured assertions. For the RC to send either of
these, use the full user request object (Section 2.4) instead. these, use the full user request object (Section 2.4) instead.
[[ Editor's note: we might be able to fold this function into an [[ See issue #51 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
unstructured user assertion reference issued by the AS to the RC. We issues/51) ]]
could put it in as an assertion type of "gnap_reference" or something
like that. Downside: it's more verbose and potentially confusing to
the client developer to have an assertion-like thing that's internal
to the AS and not an assertion. ]]
If the AS does not recognize the user reference, it MUST return an If the AS does not recognize the user reference, it MUST return an
error. error.
2.5. Interacting with the User 2.5. Interacting with the User
Many times, the AS will require interaction with the RO in order to Many times, the AS will require interaction with the RO in order to
approve a requested delegation to the RC for both resources and approve a requested delegation to the RC for both resources and
direct claim information. Many times the RQ using the RC is the same direct claim information. Many times the RQ using the RC is the same
person as the RO, and the RC can directly drive interaction with the person as the RO, and the RC can directly drive interaction with the
skipping to change at page 35, line 34 skipping to change at page 34, line 5
The "interact" field is a JSON object with keys that declare The "interact" field is a JSON object with keys that declare
different interaction modes. A RC MUST NOT declare an interaction different interaction modes. A RC MUST NOT declare an interaction
mode it does not support. The RC MAY send multiple modes in the same mode it does not support. The RC MAY send multiple modes in the same
request. There is no preference order specified in this request. An request. There is no preference order specified in this request. An
AS MAY respond to any, all, or none of the presented interaction AS MAY respond to any, all, or none of the presented interaction
modes (Section 3.3) in a request, depending on its capabilities and modes (Section 3.3) in a request, depending on its capabilities and
what is allowed to fulfill the request. This specification defines what is allowed to fulfill the request. This specification defines
the following interaction modes: the following interaction modes:
redirect Indicates that the RC can direct the RQ to an arbitrary URL redirect (boolean) Indicates that the RC can direct the RQ to an
at the AS for interaction. Section 2.5.1 arbitrary URL at the AS for interaction. Section 2.5.1
app Indicates that the RC can launch an application on the RQ's app (boolean) Indicates that the RC can launch an application on the
device for interaction. Section 2.5.2 RQ's device for interaction. Section 2.5.2
callback Indicates that the RC can receive a callback from the AS callback (object) Indicates that the RC can receive a callback from
after interaction with the RO has concluded. Section 2.5.3 the AS after interaction with the RO has concluded. Section 2.5.3
user_code Indicates that the RC can communicate a human-readable user_code (boolean) Indicates that the RC can communicate a human-
short code to the RQ for use with a stable URL at the AS. readable short code to the RQ for use with a stable URL at the AS.
Section 2.5.4 Section 2.5.4
ui_locales Indicates the RQ's preferred locales that the AS can use ui_locales (array of strings) Indicates the RQ's preferred locales
during interaction, particularly before the RO has authenticated. that the AS can use during interaction, particularly before the RO
Section 2.5.5 has authenticated. Section 2.5.5
The following sections detail requests for interaction modes. The following sections detail requests for interaction modes.
Additional interaction modes are defined in a registry TBD Additional interaction modes are defined in a registry TBD
(Section 12). (Section 12).
[[ Editor's note: there need to be more examples (Appendix C) that [[ See issue #52 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
knit together the interaction modes into common flows, like an authz- issues/52) ]]
code equivalent. But it's important for the protocol design that
these are separate pieces to allow such knitting to take place. ]]
In this non-normative example, the RC is indicating that it can In this non-normative example, the RC is indicating that it can
redirect (Section 2.5.1) the RQ to an arbitrary URL and can receive a redirect (Section 2.5.1) the RQ to an arbitrary URL and can receive a
callback (Section 2.5.3) through a browser request. callback (Section 2.5.3) through a browser request.
"interact": { "interact": {
"redirect": true, "redirect": true,
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return/123455", "uri": "https://client.example.net/return/123455",
skipping to change at page 37, line 30 skipping to change at page 35, line 39
returns a redirect interaction response Section 3.3.1. returns a redirect interaction response Section 3.3.1.
2.5.1.1. Redirect to an Arbitrary Shortened URL 2.5.1.1. Redirect to an Arbitrary Shortened URL
If the RC would prefer to redirect to a shortened URL defined by the If the RC would prefer to redirect to a shortened URL defined by the
AS at runtime, the RC indicates this by sending the "redirect" field AS at runtime, the RC indicates this by sending the "redirect" field
with an integer indicating the maximum character length of the with an integer indicating the maximum character length of the
returned URL. The AS MAY use this value to decide whether to return returned URL. The AS MAY use this value to decide whether to return
a shortened form of the response URL. If the AS cannot shorten its a shortened form of the response URL. If the AS cannot shorten its
response URL enough to fit in the requested size, the AS SHOULD response URL enough to fit in the requested size, the AS SHOULD
return an error. [[ Editor's note: Or maybe just ignore this part of return an error. [[ See issue #53 (https://github.com/ietf-wg-gnap/
the interaction request? ]] gnap-core-protocol/issues/53) ]]
"interact": { "interact": {
"redirect": 255 "redirect": 255
} }
If this interaction mode is supported for this RC and request, the AS If this interaction mode is supported for this RC and request, the AS
returns a redirect interaction response with short URL Section 3.3.1. returns a redirect interaction response with short URL Section 3.3.1.
2.5.2. Open an Application-specific URL 2.5.2. Open an Application-specific URL
skipping to change at page 38, line 4 skipping to change at page 36, line 15
2.5.2. Open an Application-specific URL 2.5.2. Open an Application-specific URL
If the RC can open a URL associated with an application on the RQ's If the RC can open a URL associated with an application on the RQ's
device, the RC indicates this by sending the "app" field with boolean device, the RC indicates this by sending the "app" field with boolean
value "true". The means by which the RC determines the application value "true". The means by which the RC determines the application
to open with this URL are out of scope of this specification. to open with this URL are out of scope of this specification.
"interact": { "interact": {
"app": true "app": true
} }
If this interaction mode is supported for this RC and request, the AS If this interaction mode is supported for this RC and request, the AS
returns an app interaction response with an app URL payload returns an app interaction response with an app URL payload
Section 3.3.2. Section 3.3.2.
[[ Editor's note: this is similar to the "redirect" above today as [[ See issue #54 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
most apps use captured URLs, but there seems to be a desire for issues/54) ]]
splitting the web-based interaction and app-based interaction into
different URIs. There's also the possibility of wanting more in the
payload than can be reasonably put into the URL, or at least having
separate payloads. ]]
2.5.3. Receive a Callback After Interaction 2.5.3. Receive a Callback After Interaction
If the RC is capable of receiving a message from the AS indicating If the RC is capable of receiving a message from the AS indicating
that the RO has completed their interaction, the RC indicates this by that the RO has completed their interaction, the RC indicates this by
sending the "callback" field. The value of this field is an object sending the "callback" field. The value of this field is an object
containing the following members. containing the following members.
uri REQUIRED. Indicates the URI to send the RO to after uri (string) REQUIRED. Indicates the URI to send the RO to after
interaction. This URI MAY be unique per request and MUST be interaction. This URI MAY be unique per request and MUST be
hosted by or accessible by the RC. This URI MUST NOT contain any hosted by or accessible by the RC. This URI MUST NOT contain any
fragment component. This URI MUST be protected by HTTPS, be fragment component. This URI MUST be protected by HTTPS, be
hosted on a server local to the RO's browser ("localhost"), or use hosted on a server local to the RO's browser ("localhost"), or use
an application-specific URI scheme. If the RC needs any state an application-specific URI scheme. If the RC needs any state
information to tie to the front channel interaction response, it information to tie to the front channel interaction response, it
MUST use a unique callback URI to link to that ongoing state. The MUST use a unique callback URI to link to that ongoing state. The
allowable URIs and URI patterns MAY be restricted by the AS based allowable URIs and URI patterns MAY be restricted by the AS based
on the RC's presented key information. The callback URI SHOULD be on the RC's presented key information. The callback URI SHOULD be
presented to the RO during the interaction phase before redirect. presented to the RO during the interaction phase before redirect.
[[ Editor's note: should we enforce the callback URI to be unique [[ See issue #55 (https://github.com/ietf-wg-gnap/gnap-core-
per request? That helps with some fixation attacks, but not with protocol/issues/55) ]]
others, and it would be problematic for an AS that wants to lock
down each client instance to a single callback instead of a
family/pattern of callbacks. ]]
nonce REQUIRED. Unique value to be used in the calculation of the nonce (string) REQUIRED. Unique value to be used in the calculation
"hash" query parameter sent to the callback URL, must be of the "hash" query parameter sent to the callback URL, must be
sufficiently random to be unguessable by an attacker. MUST be sufficiently random to be unguessable by an attacker. MUST be
generated by the RC as a unique value for this request. generated by the RC as a unique value for this request.
method REQUIRED. The callback method that the AS will use to method (string) REQUIRED. The callback method that the AS will use
contact the RC. Valid values include "redirect" Section 2.5.3.1 to contact the RC. Valid values include "redirect"
and "push" Section 2.5.3.2, with other values defined by a Section 2.5.3.1 and "push" Section 2.5.3.2, with other values
registry TBD (Section 12). defined by a registry TBD (Section 12).
hash_method OPTIONAL. The hash calculation mechanism to be used for hash_method (string) OPTIONAL. The hash calculation mechanism to be
the callback hash in Section 4.4.3. Can be one of "sha3" or used for the callback hash in Section 4.4.3. Can be one of "sha3"
"sha2". If absent, the default value is "sha3". [[ Editor's or "sha2". If absent, the default value is "sha3". [[ See issue
note: This should be expandable via a registry of cryptographic #56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/56)
options, and it would be good if we didn't define our own ]]
identifiers here. See also note about cryptographic functions in
Section 4.4.3. ]]
"interact": { "interact": {
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return/123455", "uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
} }
If this interaction mode is supported for this RC and request, the AS If this interaction mode is supported for this RC and request, the AS
returns a nonce for use in validating the callback response returns a nonce for use in validating the callback response
(Section 3.3.3). Requests to the callback URI MUST be processed as (Section 3.3.3). Requests to the callback URI MUST be processed as
described in Section 4.4, and the AS MUST require presentation of an described in Section 4.4, and the AS MUST require presentation of an
interaction callback reference as described in Section 5.1. interaction callback reference as described in Section 5.1.
[[ Editor's note: There has been some call for a post-interaction [[ See issue #58 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
redirect that is not tied to the underlying security model - issues/58) ]]
specifically, sending the user over to a client-hosted page with
client-specific instructions on how to continue. This would be
something hosted externally to the client instance, so the client
instance would never see this incoming call. We could accomplish
that using this "callback" post-redirect mechanism but with "method":
"static" or "nonce": false or some other signal to indicate that the
client won't see the incoming request. ]]
[[ Editor's note: The callback information could alternatively be
combined with other methods like "redirect", essentially putting
everything in the "callback" object into the field for the other
objects. However, this would require each method to define its own
set of rules about how callbacks can be used, and we would want them
all to be consistent with each other with clear information about how
the AS is supposed to respond to all of these.
"interact" {
"redirect": {
"method": "redirect",
"uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC"
}
}
So if the object is there, you do the redirect on completion, if the
object isn't there (it's a boolean, like today), you don't redirect
when you're done. Previous versions of this specification used this
structure, but it was abandoned in favor of the current setup to
allow for different combinations of user interaction methods at the
same time while still keeping a consistent security model. OAuth 2's
"grant_type" model has proved to be limiting in unanticipated ways
since it requires an entirely new grant type to be invented any time
there is a new combination of aspects, or it requires each grant type
to have many of the same optionalities. Combining these fields back
into one, in this way, would allow a client to declare that it
expects a callback in response to one kind of interaction method but
not others, and include multiple combinations at once. For example,
if a client wants to allow a user to redirect to the AS and back on
the same device, or to use a usercode on a secondary device without a
callback, and the client wants to offer both modes simultaneously.
This could alternately be accomplished by allowing the client to
"bundle" interaction parameters together, if desirable - for example,
if "interact" were an array, the client would accept any combination
represented by one object. This example binds the "callback" only to
the first "redirect" method, and second (short) "redirect" and
"user_code" method do not use a callback.
"interact": [
{
"redirect": true,
"callback": {
"method": "redirect",
"uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC"
}
},
{
"redirect": 255,
"user_code": true
}
]
It's not clear what a response to such an array would be. Would the
AS pick one of these bundles? Would it be allowed to respond to any
or all of them? Could an AS use different URIs for each bundle?
(This seems likely, at least.) Would there be a security problem if
the AS used the same URI for both bundles, since one requires a front
channel redirect and the other does not?
]] [[ See issue #59 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/59) ]]
2.5.3.1. Receive an HTTP Callback Through the Browser 2.5.3.1. Receive an HTTP Callback Through the Browser
A callback "method" value of "redirect" indicates that the RC will A callback "method" value of "redirect" indicates that the RC will
expect a call from the RO's browser using the HTTP method GET as expect a call from the RO's browser using the HTTP method GET as
described in Section 4.4.1. described in Section 4.4.1.
"interact": { "interact": {
"callback": { "callback": {
"method": "redirect", "method": "redirect",
skipping to change at page 41, line 48 skipping to change at page 38, line 26
} }
} }
Requests to the callback URI MUST be processed by the RC as described Requests to the callback URI MUST be processed by the RC as described
in Section 4.4.2. in Section 4.4.2.
Since the incoming request to the callback URL is from the AS and not Since the incoming request to the callback URL is from the AS and not
from the RO's browser, the RC MUST NOT require the RQ to be present from the RO's browser, the RC MUST NOT require the RQ to be present
on the incoming HTTP request. on the incoming HTTP request.
[[ Editor's note: This post-interaction method can be used in [[ See issue #60 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
advanced use cases like asynchronous authorization, or simply to issues/60) ]]
signal the client that it should move to the next part of the
protocol, even when there is no user present at the client. As such
it can feel a little odd being inside the "interact" block of the
protocol, but it does align with the redirect-based "callback" method
and it seems they really should be mutually-exclusive. Additionally,
should there be a method for simply pushing the updated response
directly to the client, instead? ]]
2.5.4. Display a Short User Code 2.5.4. Display a Short User Code
If the RC is capable of displaying or otherwise communicating a If the RC is capable of displaying or otherwise communicating a
short, human-entered code to the RO, the RC indicates this by sending short, human-entered code to the RO, the RC indicates this by sending
the "user_code" field with the boolean value "true". This code is to the "user_code" field with the boolean value "true". This code is to
be entered at a static URL that does not change at runtime, as be entered at a static URL that does not change at runtime, as
described in Section 3.3.4. described in Section 3.3.4.
"interact": { "interact": {
skipping to change at page 42, line 44 skipping to change at page 39, line 14
If possible, the AS SHOULD use one of the locales in the array, with If possible, the AS SHOULD use one of the locales in the array, with
preference to the first item in the array supported by the AS. If preference to the first item in the array supported by the AS. If
none of the given locales are supported, the AS MAY use a default none of the given locales are supported, the AS MAY use a default
locale. locale.
2.5.6. Extending Interaction Modes 2.5.6. Extending Interaction Modes
Additional interaction modes are defined in a registry TBD Additional interaction modes are defined in a registry TBD
(Section 12). (Section 12).
[[ Editor's note: we should have guidance in here about how to define [[ See issue #61 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
other interaction modes. There's already interest in defining issues/61) ]]
message-based protocols like DIDCOMM and challenge-response protocols
like FIDO, for example. ]]
2.6. Declaring RC Capabilities 2.6. Declaring RC Capabilities
If the RC supports extension capabilities, it MAY present them to the If the RC supports extension capabilities, it MAY present them to the
AS in the "capabilities" field. This field is an array of strings AS in the "capabilities" field. This field is an array of strings
representing specific extensions and capabilities, as defined by a representing specific extensions and capabilities, as defined by a
registry TBD (Section 12). registry TBD (Section 12).
"capabilities": ["ext1", "ext2"] "capabilities": ["ext1", "ext2"]
skipping to change at page 43, line 27 skipping to change at page 39, line 39
it MAY send that reference in the "existing_grant" field. This field it MAY send that reference in the "existing_grant" field. This field
is a single string consisting of the "value" of the "access_token" is a single string consisting of the "value" of the "access_token"
returned in a previous request's continuation response (Section 3.1). returned in a previous request's continuation response (Section 3.1).
"existing_grant": "80UPRY5NM33OMUKMKSKU" "existing_grant": "80UPRY5NM33OMUKMKSKU"
The AS MUST dereference the grant associated with the reference and The AS MUST dereference the grant associated with the reference and
process this request in the context of the referenced one. The AS process this request in the context of the referenced one. The AS
MUST NOT alter the existing grant associated with the reference. MUST NOT alter the existing grant associated with the reference.
[[ Editor's note: this basic capability is to allow for both step-up [[ See issue #62 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
authorization and downscoped authorization, but by explicitly issues/62) ]]
creating a new request and not modifying an existing one. What's the
best guidance for how an AS should process this? What are the use
cases that help differentiate this from modification of an existing
request? ]]
2.8. Requesting OpenID Connect Claims 2.8. Requesting OpenID Connect Claims
If the RC and AS both support OpenID Connect's claims query language If the RC and AS both support OpenID Connect's claims query language
as defined in [OIDC] Section 5.5, the RC sends the value of the as defined in [OIDC] Section 5.5, the RC sends the value of the
OpenID Connect "claims" authorization request parameter as a JSON OpenID Connect "claims" authorization request parameter as a JSON
object under the name "claims" in the root of the request. object under the name "claims" in the root of the request.
"claims": { "claims": {
"id_token" : { "id_token" : {
skipping to change at page 44, line 20 skipping to change at page 40, line 31
Note that because this is an independent query object, the "claims" Note that because this is an independent query object, the "claims"
value can augment or alter other portions of the request, namely the value can augment or alter other portions of the request, namely the
"resources" and "subject" fields. This query language uses the "resources" and "subject" fields. This query language uses the
fields in the top level of the object to indicate the target for any fields in the top level of the object to indicate the target for any
requested claims. For instance, the "userinfo" target indicates that requested claims. For instance, the "userinfo" target indicates that
a returned access token would grant access to the given claims at the a returned access token would grant access to the given claims at the
UserInfo Endpoint, while the "id_token" target indicates that the UserInfo Endpoint, while the "id_token" target indicates that the
claims would be returned in an ID Token as described in Section 3.4. claims would be returned in an ID Token as described in Section 3.4.
[[ Editor's note: in order to use the "claims" parameter as defined [[ See issue #63 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
in OIDC, we have to violate the principle of orthogonality in issues/63) ]]
Section 2.9. An alternative approach would be to split up the
portions of the claims request, so that "id_token" claims would go
into the "subject" field and "userinfo" claims would go into the
"resources" request, but this violates the original field definition
from OIDC and gets into the territory of defining an identity schema
request. This approach would also invalidate extensions to the
"claims" standard as each "target" would need to have its own
separate mapping to some part of the GNAP protocol. ]]
[[ Editor's note: I'm not a fan of GNAP defining how OIDC would work [[ See issue #64 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
at all and would rather that work be done by the OIDF in an issues/64) ]]
extension. However, I think it is important for discussion to see
this kind of thing in context with the rest of the protocol, for now.
In the future, I would anticipate this would be defined by the OIDF
as a relatively small but robust identity layer on top of GNAP. ]]
2.9. Extending The Grant Request 2.9. Extending The Grant Request
The request object MAY be extended by registering new items in a The request object MAY be extended by registering new items in a
registry TBD (Section 12). Extensions SHOULD be orthogonal to other registry TBD (Section 12). Extensions SHOULD be orthogonal to other
parameters. Extensions MUST document any aspects where the extension parameters. Extensions MUST document any aspects where the extension
item affects or influences the values or behavior of other request item affects or influences the values or behavior of other request
and response objects. and response objects.
[[ Editor's note: we should have more guidance and examples on what [[ See issue #65 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
possible top-level extensions would look like. ]] issues/65) ]]
3. Grant Response 3. Grant Response
In response to a RC's request, the AS responds with a JSON object as In response to a RC's request, the AS responds with a JSON object as
the HTTP entity body. Each possible field is detailed in the the HTTP entity body. Each possible field is detailed in the
sections below sections below
continue (object) Indicates that the RC can continue the request by
making an additional request using these parameters. Section 3.1
continue Indicates that the RC can continue the request by making an access_token (object) A single access token that the RC can use to
additional request using these parameters. Section 3.1 call the RS on behalf of the RO. Section 3.2.1
access_token A single access token that the RC can use to call the
RS on behalf of the RO. Section 3.2.1
multiple_access_token Multiple named access tokens that the RC can multiple_access_token (object) Multiple named access tokens that the
use to call the RS on behalf of the RO. Section 3.2.2 RC can use to call the RS on behalf of the RO. Section 3.2.2
interact Indicates that interaction through some set of defined interact (object) Indicates that interaction through some set of
mechanisms needs to take place. Section 3.3 defined mechanisms needs to take place. Section 3.3
subject Claims about the RO as known and declared by the AS. subject (object) Claims about the RO as known and declared by the
Section 3.4 AS. Section 3.4
instance_id An identifier this RC instance can use to identify instance_id (string) An identifier this RC instance can use to
itself when making future requests. Section 3.5 identify itself when making future requests. Section 3.5
user_handle An identifier this RC instance can use to identify its user_handle (string) An identifier this RC instance can use to
current RQ when making future requests. Section 3.5 identify its current RQ when making future requests. Section 3.5
error An error code indicating that something has gone wrong. error (object) An error code indicating that something has gone
Section 3.6 wrong. Section 3.6
In this example, the AS is returning an interaction URL In this example, the AS is returning an interaction URL
(Section 3.3.1), a callback nonce (Section 3.3.3), and a continuation (Section 3.3.1), a callback nonce (Section 3.3.3), and a continuation
handle (Section 3.1). handle (Section 3.1).
{ {
"interact": { "interact": {
"redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ", "redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ",
"callback": "MBDOFXG4Y5CVJCX821LH" "callback": "MBDOFXG4Y5CVJCX821LH"
}, },
skipping to change at page 46, line 28 skipping to change at page 42, line 25
} ] } ]
} }
} }
3.1. Request Continuation 3.1. Request Continuation
If the AS determines that the request can be continued with If the AS determines that the request can be continued with
additional requests, it responds with the "continue" field. This additional requests, it responds with the "continue" field. This
field contains a JSON object with the following properties. field contains a JSON object with the following properties.
uri REQUIRED. The URI at which the RC can make continuation uri (string) REQUIRED. The URI at which the RC can make
requests. This URI MAY vary per request, or MAY be stable at the continuation requests. This URI MAY vary per request, or MAY be
AS if the AS includes an access token. The RC MUST use this value stable at the AS if the AS includes an access token. The RC MUST
exactly as given when making a continuation request (Section 5). use this value exactly as given when making a continuation request
(Section 5).
wait RECOMMENDED. The amount of time in integer seconds the RC wait (integer) RECOMMENDED. The amount of time in integer seconds
SHOULD wait after receiving this continuation handle and calling the RC SHOULD wait after receiving this continuation handle and
the URI. calling the URI.
access_token RECOMMENDED. A unique access token for continuing the access_token (object) RECOMMENDED. A unique access token for
request, in the format specified in Section 3.2.1. This access continuing the request, in the format specified in Section 3.2.1.
token MUST be bound to the RC's key used in the request and MUST This access token MUST be bound to the RC's key used in the
NOT be a "bearer" token. This access token MUST NOT be usable at request and MUST NOT be a "bearer" token. This access token MUST
resources outside of the AS. [[ Editor's note: Is this a NOT be usable at resources outside of the AS. If the AS includes
restriction we want to enforce? ]] If the AS includes an access an access token, the RC MUST present the access token in all
token, the RC MUST present the access token in all requests to the requests to the continuation URI as described in Section 7. [[
continuation URI as described in Section 7. See issue #66 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/66) ]]
{ {
"continue": { "continue": {
"access_token": { "access_token": {
"value": "80UPRY5NM33OMUKMKSKU", "value": "80UPRY5NM33OMUKMKSKU",
"key": true "key": true
}, },
"uri": "https://server.example.com/continue", "uri": "https://server.example.com/continue",
"wait": 60 "wait": 60
} }
skipping to change at page 47, line 25 skipping to change at page 43, line 25
The RC can use the values of this field to continue the request as The RC can use the values of this field to continue the request as
described in Section 5. Note that the RC MUST sign all continuation described in Section 5. Note that the RC MUST sign all continuation
requests with its key as described in Section 8. If the AS includes requests with its key as described in Section 8. If the AS includes
an "access_token", the RC MUST present the access token in its an "access_token", the RC MUST present the access token in its
continuation request. continuation request.
This field SHOULD be returned when interaction is expected, to allow This field SHOULD be returned when interaction is expected, to allow
the RC to follow up after interaction has been concluded. the RC to follow up after interaction has been concluded.
[[ Editor's note: The AS can use the optional "access_token" as a [[ See issue #67 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
credential for the client to manage the grant request itself over issues/67) ]]
time. This is in parallel with access token management as well as RS
access in general. If the AS uses the access token, the continuation
URL can be static, and potentially even the same as the initial
request URL. If the AS does not use an access token here, it needs
to use unique URLs in its response and bind the client's key to
requests to those URLs - or potentially only allow one request per
client at a time. The optionality adds a layer of complexity, but
the client behavior is deterministic in all possible cases and it re-
uses existing functions and structures instead of inventing something
special just to talk to the AS. The optional access token represents
a design compromise, but the working group can decide to either
require the access token on all requests or to remove the access
token functionality and require the security of the continuation
requests be based on unique URLs. ]]
3.2. Access Tokens 3.2. Access Tokens
If the AS has successfully granted one or more access tokens to the If the AS has successfully granted one or more access tokens to the
RC, the AS responds with either the "access_token" or the RC, the AS responds with either the "access_token" or the
"multiple_access_token" field. The AS MUST NOT respond with both the "multiple_access_token" field. The AS MUST NOT respond with both the
"access_token" and "multiple_access_token" fields. "access_token" and "multiple_access_token" fields.
[[ Editor's note: I really don't like the dichotomy between [[ See issue #68 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
"access_token" and "multiple_access_tokens" and their being mutually issues/68) ]]
exclusive, and I think we should design away from this pattern toward
something less error-prone. ]]
3.2.1. Single Access Token 3.2.1. Single Access Token
If the RC has requested a single access token and the AS has granted If the RC has requested a single access token and the AS has granted
that access token, the AS responds with the "access_token" field. that access token, the AS responds with the "access_token" field.
The value of this field is an object with the following properties. The value of this field is an object with the following properties.
value REQUIRED. The value of the access token as a string. The value (string) REQUIRED. The value of the access token as a string.
value is opaque to the RC. The value SHOULD be limited to ASCII The value is opaque to the RC. The value SHOULD be limited to
characters to facilitate transmission over HTTP headers within ASCII characters to facilitate transmission over HTTP headers
other protocols without requiring additional encoding. within other protocols without requiring additional encoding.
manage OPTIONAL. The management URI for this access token. If manage (string) OPTIONAL. The management URI for this access token.
provided, the RC MAY manage its access token as described in
If provided, the RC MAY manage its access token as described in
Section 6. This management URI is a function of the AS and is Section 6. This management URI is a function of the AS and is
separate from the RS the RC is requesting access to. This URI separate from the RS the RC is requesting access to. This URI
MUST NOT include the access token value and SHOULD be different MUST NOT include the access token value and SHOULD be different
for each access token issued in a request. for each access token issued in a request.
resources RECOMMENDED. A description of the rights associated with resources (array of objects/strings) RECOMMENDED. A description of
this access token, as defined in Section 2.1.1. If included, this the rights associated with this access token, as defined in
MUST reflect the rights associated with the issued access token. Section 2.1.1. If included, this MUST reflect the rights
These rights MAY vary from what was requested by the RC. associated with the issued access token. These rights MAY vary
from what was requested by the RC.
expires_in OPTIONAL. The number of seconds in which the access will expires_in (integer) OPTIONAL. The number of seconds in which the
expire. The RC MUST NOT use the access token past this time. An access will expire. The RC MUST NOT use the access token past
RS MUST NOT accept an access token past this time. Note that the this time. An RS MUST NOT accept an access token past this time.
access token MAY be revoked by the AS or RS at any point prior to Note that the access token MAY be revoked by the AS or RS at any
its expiration. point prior to its expiration.
key REQUIRED. The key that the token is bound to. If the boolean key (object / string / boolean) REQUIRED. The key that the token is
value "true" is used, the token is bound to the key used by the RC bound to. If the boolean value "true" is used, the token is bound
(Section 2.3.2) in its request for access. If the boolean value to the key used by the RC (Section 2.3.2) in its request for
"false" is used, the token is a bearer token with no key bound to access. If the boolean value "false" is used, the token is a
it. Otherwise, the key MUST be an object or string in a format bearer token with no key bound to it. Otherwise, the key MUST be
described in Section 2.3.2, describing a public key to which the an object or string in a format described in Section 2.3.2,
RC can use the associated private key. The RC MUST be able to describing a public key to which the RC can use the associated
dereference or process the key information in order to be able to private key. The RC MUST be able to dereference or process the
sign the request. key information in order to be able to sign the request.
The following non-normative example shows a single bearer token with The following non-normative example shows a single bearer token with
a management URL that has access to three described resources. a management URL that has access to three described resources.
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L", "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L",
"resources": [ "resources": [
{ {
skipping to change at page 49, line 46 skipping to change at page 45, line 46
"key": true, "key": true,
"resources": [ "resources": [
"finance", "medical" "finance", "medical"
] ]
} }
If the RC requested multiple access tokens (Section 2.1.3), the AS If the RC requested multiple access tokens (Section 2.1.3), the AS
MUST NOT respond with a single access token structure unless the RC MUST NOT respond with a single access token structure unless the RC
sends the "split_token" flag as described in Section 2.1.4. sends the "split_token" flag as described in Section 2.1.4.
[[ Editor's note: There has been interest in describing a way for the [[ See issue #69 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
AS to tell the client both how and where to use the token. This kind issues/69) ]]
of directed access token could allow for some interesting deployment
patterns where the client doesn't know much]]
3.2.2. Multiple Access Tokens 3.2.2. Multiple Access Tokens
If the RC has requested multiple access tokens and the AS has granted If the RC has requested multiple access tokens and the AS has granted
at least one of them, the AS responds with the at least one of them, the AS responds with the
"multiple_access_tokens" field. The value of this field is a JSON "multiple_access_tokens" field. The value of this field is a JSON
object, and the property names correspond to the token identifiers object, and the property names correspond to the token identifiers
chosen by the RC in the multiple access token request chosen by the RC in the multiple access token request
(Section 2.1.3). The values of the properties of this object are (Section 2.1.3). The values of the properties of this object are
access tokens as described in Section 3.2.1. access tokens as described in Section 3.2.1.
skipping to change at page 50, line 50 skipping to change at page 46, line 50
names. names.
If the RC requested a single access token (Section 2.1.1), the AS If the RC requested a single access token (Section 2.1.1), the AS
MUST NOT respond with the multiple access token structure unless the MUST NOT respond with the multiple access token structure unless the
RC sends the "split_token" flag as described in Section 2.1.4. RC sends the "split_token" flag as described in Section 2.1.4.
Each access token MAY have different proofing mechanisms. If Each access token MAY have different proofing mechanisms. If
management is allowed, each access token SHOULD have different management is allowed, each access token SHOULD have different
management URIs. management URIs.
[[ Editor's note: Do we need to specify that the management URIs are [[ See issue #70 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
different if we require the token to be presented? ]] issues/70) ]]
3.3. Interaction Modes 3.3. Interaction Modes
If the RC has indicated a capability to interact with the RO in its If the RC has indicated a capability to interact with the RO in its
request (Section 2.5), and the AS has determined that interaction is request (Section 2.5), and the AS has determined that interaction is
both supported and necessary, the AS responds to the RC with any of both supported and necessary, the AS responds to the RC with any of
the following values in the "interact" field of the response. There the following values in the "interact" field of the response. There
is no preference order for interaction modes in the response, and it is no preference order for interaction modes in the response, and it
is up to the RC to determine which ones to use. All supported is up to the RC to determine which ones to use. All supported
interaction methods are included in the same "interact" object. interaction methods are included in the same "interact" object.
redirect Redirect to an arbitrary URL. Section 3.3.1 redirect (string) Redirect to an arbitrary URL. Section 3.3.1
app Launch of an application URL. Section 3.3.2 app (string) Launch of an application URL. Section 3.3.2
callback Callback to an RC URL after interaction is completed. callback (string) Callback to an RC URL after interaction is
Section 3.3.3 completed. Section 3.3.3
user_code Display a short user code. Section 3.3.4 user_code (object) Display a short user code. Section 3.3.4
Additional interaction mode responses can be defined in a registry Additional interaction mode responses can be defined in a registry
TBD (Section 12). TBD (Section 12).
The AS MUST NOT respond with any interaction mode that the RC did not The AS MUST NOT respond with any interaction mode that the RC did not
indicate in its request. The AS MUST NOT respond with any indicate in its request. The AS MUST NOT respond with any
interaction mode that the AS does not support. Since interaction interaction mode that the AS does not support. Since interaction
responses include secret or unique information, the AS SHOULD respond responses include secret or unique information, the AS SHOULD respond
to each interaction mode only once in an ongoing request, to each interaction mode only once in an ongoing request,
particularly if the RC modifies its request (Section 5.3). particularly if the RC modifies its request (Section 5.3).
skipping to change at page 52, line 5 skipping to change at page 47, line 51
"interact": { "interact": {
"redirect": "https://interact.example.com/4CF492MLVMSW9MKMXKHQ" "redirect": "https://interact.example.com/4CF492MLVMSW9MKMXKHQ"
} }
The interaction URL returned represents a function of the AS but MAY The interaction URL returned represents a function of the AS but MAY
be completely distinct from the URL the RC uses to request access be completely distinct from the URL the RC uses to request access
(Section 2), allowing an AS to separate its user-interactive (Section 2), allowing an AS to separate its user-interactive
functionality from its back-end security functionality. functionality from its back-end security functionality.
[[ Editor's note: This is one aspect where the AS might actually be [[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
two separate roles. Namely, a delegation server (back end) and issues/72) ]]
interaction server (user-facing).]]
The RC sends the RQ to the URL to interact with the AS. The RC MUST The RC sends the RQ to the URL to interact with the AS. The RC MUST
NOT alter the URL in any way. The means for the RC to send the RQ to NOT alter the URL in any way. The means for the RC to send the RQ to
this URL is out of scope of this specification, but common methods this URL is out of scope of this specification, but common methods
include an HTTP redirect, launching the system browser, displaying a include an HTTP redirect, launching the system browser, displaying a
scannable code, or printing out the URL in an interactive console. scannable code, or printing out the URL in an interactive console.
3.3.2. Launch of an application URL 3.3.2. Launch of an application URL
If the RC indicates that it can launch an application URL If the RC indicates that it can launch an application URL
(Section 2.5.2) and the AS supports this mode for the RC's request, (Section 2.5.2) and the AS supports this mode for the RC's request,
skipping to change at page 52, line 33 skipping to change at page 48, line 28
"interact": { "interact": {
"app": "https://app.example.com/launch?tx=4CF492MLV" "app": "https://app.example.com/launch?tx=4CF492MLV"
} }
The RC launches the URL as appropriate on its platform, and the means The RC launches the URL as appropriate on its platform, and the means
for the RC to launch this URL is out of scope of this specification. for the RC to launch this URL is out of scope of this specification.
The RC MUST NOT alter the URL in any way. The RC MAY attempt to The RC MUST NOT alter the URL in any way. The RC MAY attempt to
detect if an installed application will service the URL being sent detect if an installed application will service the URL being sent
before attempting to launch the application URL. before attempting to launch the application URL.
[[ Editor's note: This will probably need to be expanded to an object [[ See issue #71 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
to account for other parameters needed in app2app use cases, like issues/71) ]]
addresses for distributed storage systems, server keys, and the like.
Details TBD as people build this out. ]]
3.3.3. Post-interaction Callback to an RC URL 3.3.3. Post-interaction Callback to an RC URL
If the RC indicates that it can receive a post-interaction callback If the RC indicates that it can receive a post-interaction callback
on a URL (Section 2.5.3) and the AS supports this mode for the RC's on a URL (Section 2.5.3) and the AS supports this mode for the RC's
request, the AS responds with a "callback" field containing a nonce request, the AS responds with a "callback" field containing a nonce
that the RC will use in validating the callback as defined in that the RC will use in validating the callback as defined in
Section 4.4.1. Section 4.4.1.
"interact": { "interact": {
"callback": "MBDOFXG4Y5CVJCX821LH" "callback": "MBDOFXG4Y5CVJCX821LH"
} }
[[ Editor's note: This is fairly parallel to the request but it kinda [[ See issue #73 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
hides the fact that this is a nonce from the AS, not the client. ]] issues/73) ]]
When the RO completes interaction at the AS, the AS MUST call the When the RO completes interaction at the AS, the AS MUST call the
RC's callback URL using the method indicated in the callback request RC's callback URL using the method indicated in the callback request
(Section 2.5.3) as described in Section 4.4.1. (Section 2.5.3) as described in Section 4.4.1.
If the AS returns a "callback" nonce, the RC MUST NOT continue a If the AS returns a "callback" nonce, the RC MUST NOT continue a
grant request before it receives the associated interaction reference grant request before it receives the associated interaction reference
on the callback URI. on the callback URI.
3.3.4. Display of a Short User Code 3.3.4. Display of a Short User Code
If the RC indicates that it can display a short user-typeable code If the RC indicates that it can display a short user-typeable code
(Section 2.5.4) and the AS supports this mode for the RC's request, (Section 2.5.4) and the AS supports this mode for the RC's request,
the AS responds with a "user_code" field. This field is an object the AS responds with a "user_code" field. This field is an object
that contains the following members. that contains the following members.
code REQUIRED. A unique short code that the user can type into an code (string) REQUIRED. A unique short code that the user can type
authorization server. This string MUST be case-insensitive, MUST into an authorization server. This string MUST be case-
consist of only easily typeable characters (such as letters or insensitive, MUST consist of only easily typeable characters (such
numbers). The time in which this code will be accepted SHOULD be as letters or numbers). The time in which this code will be
short lived, such as several minutes. It is RECOMMENDED that this accepted SHOULD be short lived, such as several minutes. It is
code be no more than eight characters in length. RECOMMENDED that this code be no more than eight characters in
length.
url RECOMMENDED. The interaction URL that the RC will direct the RO url (string) RECOMMENDED. The interaction URL that the RC will
to. This URL MUST be stable at the AS such that RCs can be direct the RO to. This URL MUST be stable at the AS such that RCs
statically configured with it. can be statically configured with it.
"interact": { "interact": {
"user_code": { "user_code": {
"code": "A1BC-3DFF", "code": "A1BC-3DFF",
"url": "https://srv.ex/device" "url": "https://srv.ex/device"
} }
} }
The RC MUST communicate the "code" to the RQ in some fashion, such as The RC MUST communicate the "code" to the RQ in some fashion, such as
displaying it on a screen or reading it out audibly. The "code" is a displaying it on a screen or reading it out audibly. The "code" is a
skipping to change at page 54, line 16 skipping to change at page 50, line 13
If the RC is capable of communicating an arbitrary URL to the RQ, If the RC is capable of communicating an arbitrary URL to the RQ,
such as through a scannable code, the RC can use the "redirect" such as through a scannable code, the RC can use the "redirect"
(Section 2.5.1) mode for this purpose instead of or in addition to (Section 2.5.1) mode for this purpose instead of or in addition to
the user code mode. the user code mode.
The interaction URL returned represents a function of the AS but MAY The interaction URL returned represents a function of the AS but MAY
be completely distinct from the URL the RC uses to request access be completely distinct from the URL the RC uses to request access
(Section 2), allowing an AS to separate its user-interactive (Section 2), allowing an AS to separate its user-interactive
functionality from its back-end security functionality. functionality from its back-end security functionality.
[[ Editor's note: This is one aspect where the AS might actually be [[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
two separate roles. Namely, a delegation server (back end) and issues/72) ]]
interaction server (user-facing).]]
3.3.5. Extending Interaction Mode Responses 3.3.5. Extending Interaction Mode Responses
Extensions to this specification can define new interaction mode Extensions to this specification can define new interaction mode
responses in a registry TBD (Section 12). Extensions MUST document responses in a registry TBD (Section 12). Extensions MUST document
the corresponding interaction request. the corresponding interaction request.
3.4. Returning User Information 3.4. Returning User Information
If information about the RO is requested and the AS grants the RC If information about the RO is requested and the AS grants the RC
access to that data, the AS returns the approved information in the access to that data, the AS returns the approved information in the
"subject" response field. This field is an object with the following "subject" response field. This field is an object with the following
OPTIONAL properties. OPTIONAL properties.
sub_ids An array of subject identifiers for the RO, as defined by sub_ids (array of strings) An array of subject identifiers for the
[I-D.ietf-secevent-subject-identifiers]. [[ Editor's note: privacy RO, as defined by [I-D.ietf-secevent-subject-identifiers]. [[ See
considerations are needed around returning identifiers. ]] issue #74 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/74) ]]
assertions An object containing assertions as values keyed on the assertions (object) An object containing assertions as values keyed
assertion type defined by a registry TBD (Section 12). [[ on the assertion type defined by a registry TBD (Section 12). [[
Editor's note: should this be an array of objects with internal See issue #41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
typing like the sub_ids? Do we expect more than one assertion per issues/41) ]]
user anyway? ]]
updated_at Timestamp as an ISO8610 date string, indicating when the updated_at (string) Timestamp as an ISO8610 date string, indicating
identified account was last updated. The RC MAY use this value to when the identified account was last updated. The RC MAY use this
determine if it needs to request updated profile information value to determine if it needs to request updated profile
through an identity API. The definition of such an identity API information through an identity API. The definition of such an
is out of scope for this specification. identity API is out of scope for this specification.
"subject": { "subject": {
"sub_ids": [ { "sub_ids": [ {
"subject_type": "email", "subject_type": "email",
"email": "user@example.com", "email": "user@example.com",
} ], } ],
"assertions": { "assertions": {
"id_token": "eyj..." "id_token": "eyj..."
} }
} }
skipping to change at page 55, line 38 skipping to change at page 51, line 38
phone number only identifies the RO to the AS and does not indicate phone number only identifies the RO to the AS and does not indicate
that the AS has validated that the represented email address or phone that the AS has validated that the represented email address or phone
number in the identifier is suitable for communication with the number in the identifier is suitable for communication with the
current user. To get such information, the RC MUST use an identity current user. To get such information, the RC MUST use an identity
protocol to request and receive additional identity claims. While protocol to request and receive additional identity claims. While
Section 2.8 specifies one such method, other identity protocols could Section 2.8 specifies one such method, other identity protocols could
also be used on top of GNAP to convey this information and the also be used on top of GNAP to convey this information and the
details of an identity protocol and associated schema are outside the details of an identity protocol and associated schema are outside the
scope of this specification. scope of this specification.
[[ Editor's note: subject identifiers here are naturally scoped to [[ See issue #75 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
the AS; even though using an external identifier like an email issues/75) ]]
address or phone number implies a global namespace in use, the
association of that identifier to the current user is still under the
view of the AS. Would changing the name to "as_sub_ids" or
"local_sub_ids" help convey that point? Would it also be desirable
to have an identifier that's globally unique by design? The
"iss_sub" type almost gets us there by explicitly calling out the
issuer URL, but tuples are hard to deal with in practice and so tend
to get ignored in practice in the OIDC space. ]]
[[ Editor's note: This will need substantial privacy considerations, [[ See issue #74 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
as this is releasing information about the current user that could be issues/74) ]]
tied to other information at the RC or elsewhere. To facilitate
this, should we have another form of identifier that's a globally
unique identifier of some form? DIDs could facilitate that kind of
namespace. ]]
Extensions to this specification MAY define additional response Extensions to this specification MAY define additional response
properties in a registry TBD (Section 12). properties in a registry TBD (Section 12).
3.5. Returning Dynamically-bound Reference Handles 3.5. Returning Dynamically-bound Reference Handles
Many parts of the RC's request can be passed as either a value or a Many parts of the RC's request can be passed as either a value or a
reference. The use of a reference in place of a value allows for a reference. The use of a reference in place of a value allows for a
client to optimize requests to the AS. client to optimize requests to the AS.
skipping to change at page 56, line 39 skipping to change at page 52, line 23
multiple interactions with the same software. The RC SHOULD use multiple interactions with the same software. The RC SHOULD use
these references in future requests in lieu of sending the associated these references in future requests in lieu of sending the associated
data value. These handles are intended to be used on future data value. These handles are intended to be used on future
requests. requests.
Dynamically generated handles are string values that MUST be Dynamically generated handles are string values that MUST be
protected by the RC as secrets. Handle values MUST be unguessable protected by the RC as secrets. Handle values MUST be unguessable
and MUST NOT contain any sensitive information. Handle values are and MUST NOT contain any sensitive information. Handle values are
opaque to the RC. opaque to the RC.
[[ Editor's note: these constructs used to be objects to allow for [[ See issue #76 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
expansion to future fields, like a management URI or different issues/76) ]]
presentation types or expiration, but those weren't used in practice.
Is that desirable anymore or is collapsing them like this the right
direction? ]]
All dynamically generated handles are returned as fields in the root All dynamically generated handles are returned as fields in the root
JSON object of the response. This specification defines the JSON object of the response. This specification defines the
following dynamic handle returns, additional handles can be defined following dynamic handle returns, additional handles can be defined
in a registry TBD (Section 12). in a registry TBD (Section 12).
instance_id A string value used to represent the information in the instance_id (string) A string value used to represent the
"client" object that the RC can use in a future request, as information in the "client" object that the RC can use in a future
described in Section 2.3.1. request, as described in Section 2.3.1.
user_handle A string value used to represent the current user. The user_handle (string) A string value used to represent the current
RC can use in a future request, as described in Section 2.4.1. user. The RC can use in a future request, as described in
Section 2.4.1.
This non-normative example shows two handles along side an issued This non-normative example shows two handles along side an issued
access token. access token.
{ {
"user_handle": "XUT2MFM1XBIKJKSDU8QM", "user_handle": "XUT2MFM1XBIKJKSDU8QM",
"instance_id": "7C7C4AZ9KHRS6X63AJAO", "instance_id": "7C7C4AZ9KHRS6X63AJAO",
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": false "key": false
} }
} }
[[ Editor's note: the ability to dynamically return reference handles [[ See issue #77 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
allows for an inline version of dynamic registration without needing issues/77) ]]
to go through a discrete registration step, for clients where that
makes sense. Currently this is entirely up to the AS to decide when
to issue these, but maybe the client should signal that it can
receive these handles as part of the request? The new "token flags"
construct in Section 2.1.4 almost gets at that, but for a different
part of the request structure. Since the client is the component
that will know if it's in a position to make use of such reference
handles in the future (like a mobile app) or if it's just going to
evaporate at the end of a session (like an SPA). Ultimately we need
to deal with a range of dynamism, not just the "pre-registered" vs.
"non-registered" use cases that OAuth forces us in to. ]]
[[ Editor's note: The client-bound "instance_id" could serve as the
hook we would need for RFC7592 style dynamic client management,
including additional components like key rotation. If the AS returns
an object instead of a string here, that could include everything
that the client would need in order to make REST-style management
calls, similar to token management.
{ [[ See issue #78 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
"client": { issues/78) ]]
"instance_id": "7C7C4AZ9KHRS6X63AJAO",
"manage": "https://example.server.com/client/7C7C4AZ9KHRS6X63AJAO",
"access_token": {
"value": "4TB8N6BW7OZB8CDFONP219RP1LT0OS9M2PMHKUR6",
"key": true
}
}
}
The client would sign all requests with its key and use the presented
access token. A "POST" or "PATCH" request would update client
information, including having a method for key rotation using nested
signatures. A "DELETE" request would un-register the client, etc. ]]
3.6. Error Response 3.6. Error Response
If the AS determines that the request cannot be issued for any If the AS determines that the request cannot be issued for any
reason, it responds to the RC with an error message. reason, it responds to the RC with an error message.
error The error code. error (string) The error code.
{ {
"error": "user_denied" "error": "user_denied"
} }
The error code is one of the following, with additional values The error code is one of the following, with additional values
available in a registry TBD (Section 12): available in a registry TBD (Section 12):
user_denied The RO denied the request. user_denied The RO denied the request.
too_fast The RC did not respect the timeout in the wait response. too_fast The RC did not respect the timeout in the wait response.
unknown_request The request referenced an unknown ongoing access unknown_request The request referenced an unknown ongoing access
request. request.
[[ Editor's note: I think we will need a more robust error mechanism, [[ See issue #79 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
and we need to be more clear about what error states are allowed in issues/79) ]]
what circumstances. Additionally, is the "error" parameter exclusive
with others in the return? ]]
3.7. Extending the Response 3.7. Extending the Response
Extensions to this specification MAY define additional fields for the Extensions to this specification MAY define additional fields for the
grant response in a registry TBD (Section 12). grant response in a registry TBD (Section 12).
[[ Editor's note: what guidance should we give to designers on this? [[ See issue #80 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
]] issues/80) ]]
4. Interaction at the AS 4. Interaction at the AS
If the RC indicates that it is capable of driving interaction with If the RC indicates that it is capable of driving interaction with
the RO in its request (Section 2.5), and the AS determines that the RO in its request (Section 2.5), and the AS determines that
interaction is required and responds to one or more of the RC's interaction is required and responds to one or more of the RC's
interaction modes, the RC SHOULD initiate one of the returned interaction modes, the RC SHOULD initiate one of the returned
interaction modes in the response (Section 3.3). interaction modes in the response (Section 3.3).
When the RO is interacting with the AS, the AS MAY perform whatever When the RO is interacting with the AS, the AS MAY perform whatever
skipping to change at page 59, line 20 skipping to change at page 54, line 17
* gather consent and authorization from the RO for access to * gather consent and authorization from the RO for access to
requested resources and direct information requested resources and direct information
* allow the RO to modify the parameters of the request (such as * allow the RO to modify the parameters of the request (such as
disallowing some requested resources or specifying an account or disallowing some requested resources or specifying an account or
record) record)
* provide warnings to the RO about potential attacks or negative * provide warnings to the RO about potential attacks or negative
effects of the requested information effects of the requested information
[[ Editor's note: there are some privacy and security considerations [[ See issue #81 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
here but for the most part we don't want to be overly prescriptive issues/81) ]]
about the UX, I think. ]]
4.1. Interaction at a Redirected URI 4.1. Interaction at a Redirected URI
When the RO is directed to the AS through the "redirect" When the RO is directed to the AS through the "redirect"
(Section 3.3.1) mode, the AS can interact with the RO through their (Section 3.3.1) mode, the AS can interact with the RO through their
web browser to authenticate the user as an RO and gather their web browser to authenticate the user as an RO and gather their
consent. Note that since the RC does not add any parameters to the consent. Note that since the RC does not add any parameters to the
URL, the AS MUST determine the grant request being referenced from URL, the AS MUST determine the grant request being referenced from
the URL value itself. If the URL cannot be associated with a the URL value itself. If the URL cannot be associated with a
currently active request, the AS MUST display an error to the RO and currently active request, the AS MUST display an error to the RO and
skipping to change at page 60, line 25 skipping to change at page 55, line 23
happens asynchronously. happens asynchronously.
4.3. Interaction through an Application URI 4.3. Interaction through an Application URI
When the RC successfully launches an application through the "app" When the RC successfully launches an application through the "app"
mode (Section 3.3.2), the AS interacts with the RO through that mode (Section 3.3.2), the AS interacts with the RO through that
application to authenticate the user as the RO and gather their application to authenticate the user as the RO and gather their
consent. The details of this interaction are out of scope for this consent. The details of this interaction are out of scope for this
specification. specification.
[[ Editor's note: Should we have anything to say about an app sending [[ See issue #82 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
information to a back-end to get details on the pending request? ]] issues/82) ]]
4.4. Post-Interaction Completion 4.4. Post-Interaction Completion
Upon completing an interaction with the RO, if a "callback" Upon completing an interaction with the RO, if a "callback"
(Section 3.3.3) mode is available with the current request, the AS (Section 3.3.3) mode is available with the current request, the AS
MUST follow the appropriate method at the end of interaction to allow MUST follow the appropriate method at the end of interaction to allow
the RC to continue. If this mode is not available, the AS SHOULD the RC to continue. If this mode is not available, the AS SHOULD
instruct the RO to return to their RC software upon completion. Note instruct the RO to return to their RC software upon completion. Note
that these steps still take place in most error cases, such as when that these steps still take place in most error cases, such as when
the RO has denied access. This pattern allows the RC to potentially the RO has denied access. This pattern allows the RC to potentially
recover from the error state without restarting the request from recover from the error state without restarting the request from
scratch by modifying its request or providing additional information scratch by modifying its request or providing additional information
directly to the AS. directly to the AS.
[[ Editor's note: there might be some other kind of push-based [[ See issue #83 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
notification or callback that the client can use, or an out-of-band issues/83) ]]
non-HTTP protocol. The AS would know about this if supported and
used, but the guidance here should be written in such a way as to not
be too restrictive in the next steps that it can take. Still, it's
important that the AS not expect or even allow clients to poll if the
client has stated it can take a callback of some form, otherwise that
sets up a potential session fixation attack vector that the client is
trying to and able to avoid. There has also been a call for post-
interaction that doesn't tie into the security of the protocol, like
redirecting to a static webpage hosted by the client's company.
Would this fit here? ]]
The AS MUST create an interaction reference and associate that The AS MUST create an interaction reference and associate that
reference with the current interaction and the underlying pending reference with the current interaction and the underlying pending
request. This value MUST be sufficiently random so as not to be request. This value MUST be sufficiently random so as not to be
guessable by an attacker. The interaction reference MUST be one- guessable by an attacker. The interaction reference MUST be one-
time-use. time-use.
The AS MUST calculate a hash value based on the RC and AS nonces and The AS MUST calculate a hash value based on the RC and AS nonces and
the interaction reference, as described in Section 4.4.3. The RC the interaction reference, as described in Section 4.4.3. The RC
will use this value to validate the return call from the AS. will use this value to validate the return call from the AS.
skipping to change at page 62, line 25 skipping to change at page 56, line 50
4.4.2. Completing Interaction with a Direct HTTP Request Callback 4.4.2. Completing Interaction with a Direct HTTP Request Callback
When using the "callback" interaction mode (Section 3.3.3) with the When using the "callback" interaction mode (Section 3.3.3) with the
"push" method, the AS signals to the RC that interaction is complete "push" method, the AS signals to the RC that interaction is complete
and the request can be continued by sending an HTTP POST request to and the request can be continued by sending an HTTP POST request to
the RC's callback URL sent in the callback request (Section 2.5.3.2). the RC's callback URL sent in the callback request (Section 2.5.3.2).
The entity message body is a JSON object consisting of the following The entity message body is a JSON object consisting of the following
two fields: two fields:
hash REQUIRED. The interaction hash value as described in hash (string) REQUIRED. The interaction hash value as described in
Section 4.4.3. Section 4.4.3.
interact_ref REQUIRED. The interaction reference generated for this interact_ref (string) REQUIRED. The interaction reference generated
interaction. for this interaction.
POST /push/554321 HTTP/1.1 POST /push/554321 HTTP/1.1
Host: client.example.net Host: client.example.net
Content-Type: application/json Content-Type: application/json
{ {
"hash": "p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A", "hash": "p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A",
"interact_ref": "4IFWWIKYBC2PQ6U56NL1" "interact_ref": "4IFWWIKYBC2PQ6U56NL1"
} }
skipping to change at page 63, line 5 skipping to change at page 57, line 31
4.4.3. Calculating the interaction hash 4.4.3. Calculating the interaction hash
The "hash" parameter in the request to the RC's callback URL ties the The "hash" parameter in the request to the RC's callback URL ties the
front channel response to an ongoing request by using values known front channel response to an ongoing request by using values known
only to the parties involved. This security mechanism allows the RC only to the parties involved. This security mechanism allows the RC
to protect itself against several kinds of session fixation and to protect itself against several kinds of session fixation and
injection attacks. The AS MUST always provide this hash, and the RC injection attacks. The AS MUST always provide this hash, and the RC
MUST validate the hash when received. MUST validate the hash when received.
[[ Editor's note: If the client uses a unique callback URL per [[ See issue #84 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
request, that prevents some of the same attacks, but without the same issues/84) ]]
cryptographic binding between the interaction and delegation
channels. A unique URI would allow the client to differentiate
inputs, but it would not prevent an attacker from injecting an
unrelated interaction reference into this channel. ]]
To calculate the "hash" value, the party doing the calculation first To calculate the "hash" value, the party doing the calculation first
takes the "nonce" value sent by the RC in the interaction section of takes the "nonce" value sent by the RC in the interaction section of
the initial request (Section 2.5.3), the AS's nonce value from the the initial request (Section 2.5.3), the AS's nonce value from the
callback response (Section 3.3.3), and the "interact_ref" sent to the callback response (Section 3.3.3), and the "interact_ref" sent to the
RC's callback URL. These three values are concatenated to each other RC's callback URL. These three values are concatenated to each other
in this order using a single newline character as a separator between in this order using a single newline character as a separator between
the fields. There is no padding or whitespace before or after any of the fields. There is no padding or whitespace before or after any of
the lines, and no trailing newline character. the lines, and no trailing newline character.
VJLO6A4CAYLBXHTR0KRO VJLO6A4CAYLBXHTR0KRO
MBDOFXG4Y5CVJCX821LH MBDOFXG4Y5CVJCX821LH
4IFWWIKYBC2PQ6U56NL1 4IFWWIKYBC2PQ6U56NL1
The party then hashes this string with the appropriate algorithm The party then hashes this string with the appropriate algorithm
based on the "hash_method" parameter of the "callback". If the based on the "hash_method" parameter of the "callback". If the
"hash_method" value is not present in the RC's request, the algorithm "hash_method" value is not present in the RC's request, the algorithm
defaults to "sha3". defaults to "sha3".
[[ Editor's note: these hash algorithms should be pluggable, and [[ See issue #56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
ideally we shouldn't redefine yet another crypto registry for this issues/56) ]]
purpose, but I'm not convinced an appropriate one already exists.
Furthermore, we should be following best practices here whether it's
a plain hash, a keyed MAC, an HMAC, or some other form of
cryptographic function. I'm not sure what the defaults and options
ought to be, but SHA512 and SHA3 were picked based on what was
available to early developers. ]]
4.4.3.1. SHA3-512 4.4.3.1. SHA3-512
The "sha3" hash method consists of hashing the input string with the The "sha3" hash method consists of hashing the input string with the
512-bit SHA3 algorithm. The byte array is then encoded using URL 512-bit SHA3 algorithm. The byte array is then encoded using URL
Safe Base64 with no padding. The resulting string is the hash value. Safe Base64 with no padding. The resulting string is the hash value.
p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A
4.4.3.2. SHA2-512 4.4.3.2. SHA2-512
skipping to change at page 64, line 28 skipping to change at page 58, line 45
To enable this ongoing negotiation, the AS returns a "continue" field To enable this ongoing negotiation, the AS returns a "continue" field
in the response (Section 3.1) that contains information the RC needs in the response (Section 3.1) that contains information the RC needs
to continue this process with another request, including a URI to to continue this process with another request, including a URI to
access as well as an optional access token to use during the access as well as an optional access token to use during the
continued requests. continued requests.
When the RC makes any calls to the continuation URL, the RC MUST When the RC makes any calls to the continuation URL, the RC MUST
present proof of the most recent key associated with this ongoing present proof of the most recent key associated with this ongoing
request by signing the request as described in Section 8. The key in request by signing the request as described in Section 8. The key in
use will be either the key from the initial request (Section 2.3.2) use will be either the key from the initial request (Section 2.3.2)
or its most recent rotation. [[ Editor's note: we need to have a or its most recent rotation. [[ See issue #85 (https://github.com/
secure way to rotate the key used for the continuation here. In most ietf-wg-gnap/gnap-core-protocol/issues/85) ]]
cases this will be a rotation for the client instance, since a client
without an instance record would likely just present a new key for a
new request. In that case it could go with the client management,
above - but it doesn't necessarily have to be. ]]
For example, here the RC makes a POST request and signs with detached For example, here the RC makes a POST request and signs with detached
JWS: JWS:
POST /continue/80UPRY5NM33OMUKMKSKU HTTP/1.1 POST /continue/80UPRY5NM33OMUKMKSKU HTTP/1.1
Host: server.example.com Host: server.example.com
Detached-JWS: ejy0... Detached-JWS: ejy0...
If the AS includes an "access_token" in the "continue" response in If the AS includes an "access_token" in the "continue" response in
Section 3.1, the RC MUST include the access token the request as Section 3.1, the RC MUST include the access token the request as
skipping to change at page 65, line 31 skipping to change at page 59, line 43
to map the continuation request to, the AS MUST return an error. to map the continuation request to, the AS MUST return an error.
The ability to continue an already-started request allows the RC to The ability to continue an already-started request allows the RC to
perform several important functions, including presenting additional perform several important functions, including presenting additional
information from interaction, modifying the initial request, and information from interaction, modifying the initial request, and
getting the current state of the request. getting the current state of the request.
If a "wait" parameter was included in the continuation response If a "wait" parameter was included in the continuation response
(Section 3.1), the RC MUST NOT call the continuation URI prior to (Section 3.1), the RC MUST NOT call the continuation URI prior to
waiting the number of seconds indicated. If no "wait" period is waiting the number of seconds indicated. If no "wait" period is
indicated, the RC SHOULD wait at least 5 seconds [[ Editor's note: indicated, the RC SHOULD wait at least 5 seconds If the RC does not
what's a reasonable amount of time so as not to DOS the server?? ]]. respect the given wait period, the AS MUST return an error. [[ See
If the RC does not respect the given wait period, the AS MUST return issue #86 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
an error. issues/86) ]]
The response from the AS is a JSON object and MAY contain any of the The response from the AS is a JSON object and MAY contain any of the
fields described in Section 3, as described in more detail in the fields described in Section 3, as described in more detail in the
sections below. sections below.
If the AS determines that the RC can make a further continuation If the AS determines that the RC can make a further continuation
request, the AS MUST include a new "continue" response (Section 3.1). request, the AS MUST include a new "continue" response (Section 3.1).
If the continuation was previously bound to an access token, the new If the continuation was previously bound to an access token, the new
"continue" response MUST include a bound access token as well, and "continue" response MUST include a bound access token as well, and
this token SHOULD be a new access token. [[ Editor's note: this used this token SHOULD be a new access token. If the AS does not return a
to be a MUST, but is it safe to back off that requirement? ]] If the new "continue" response, the RC MUST NOT make an additional
AS does not return a new "continue" response, the RC MUST NOT make an continuation request. If a RC does so, the AS MUST return an error.
additional continuation request. If a RC does so, the AS MUST return [[ See issue #87 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
an error. issues/87) ]]
For continuation functions that require the RC to send a message For continuation functions that require the RC to send a message
body, the body MUST be a JSON object. body, the body MUST be a JSON object.
5.1. Continuing After a Completed Interaction 5.1. Continuing After a Completed Interaction
When the AS responds to the RC's "callback" parameter as in When the AS responds to the RC's "callback" parameter as in
Section 4.4.1, this response includes an interaction reference. The Section 4.4.1, this response includes an interaction reference. The
RC MUST include that value as the field "interact_ref" in a POST RC MUST include that value as the field "interact_ref" in a POST
request to the continuation URI. request to the continuation URI.
skipping to change at page 66, line 32 skipping to change at page 60, line 45
in Section 4.4.1, if the RC needs to make additional continuation in Section 4.4.1, if the RC needs to make additional continuation
calls after this request, the RC MUST NOT include the interaction calls after this request, the RC MUST NOT include the interaction
reference. If the AS detects an RC submitting the same interaction reference. If the AS detects an RC submitting the same interaction
reference multiple times, the AS MUST return an error and SHOULD reference multiple times, the AS MUST return an error and SHOULD
invalidate the ongoing request. invalidate the ongoing request.
The Section 3 MAY contain any newly-created access tokens The Section 3 MAY contain any newly-created access tokens
(Section 3.2) or newly-released subject claims (Section 3.4). The (Section 3.2) or newly-released subject claims (Section 3.4). The
response MAY contain a new "continue" response (Section 3.1) as response MAY contain a new "continue" response (Section 3.1) as
described above. The response SHOULD NOT contain any interaction described above. The response SHOULD NOT contain any interaction
responses (Section 3.3). [[ Editor's note: This last one might be responses (Section 3.3). [[ See issue #89 (https://github.com/ietf-
overly restrictive, since some kinds of interaction could require wg-gnap/gnap-core-protocol/issues/89) ]]
multiple round trips. We need more examples and experience beyond
redirect-based interaction here. ]]
For example, if the request is successful in causing the AS to issue For example, if the request is successful in causing the AS to issue
access tokens and release subject claims, the response could look access tokens and release subject claims, the response could look
like this: like this:
{ {
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L" "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L"
skipping to change at page 67, line 22 skipping to change at page 61, line 22
"sub_ids": [ { "sub_ids": [ {
"subject_type": "email", "subject_type": "email",
"email": "user@example.com", "email": "user@example.com",
} ] } ]
} }
} }
With this example, the RC can not make an additional continuation With this example, the RC can not make an additional continuation
request because a "continue" field is not included. request because a "continue" field is not included.
[[ Editor's note: other interaction methods, such as a challenge- [[ See issue #88 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
response cryptographic protocol, would use a similar construct as issues/88) ]]
here, but have different rules. Would it be reasonable to allow them
to be combined? Could this be combined further with the "update"
method in Section 5.3? ]]
5.2. Continuing During Pending Interaction 5.2. Continuing During Pending Interaction
When the RC does not include a "callback" parameter, the RC will When the RC does not include a "callback" parameter, the RC will
often need to poll the AS until the RO has authorized the request. often need to poll the AS until the RO has authorized the request.
To do so, the RC makes a POST request to the continuation URI as in To do so, the RC makes a POST request to the continuation URI as in
Section 5.1, but does not include a message body. Section 5.1, but does not include a message body.
POST /continue HTTP/1.1 POST /continue HTTP/1.1
Host: server.example.com Host: server.example.com
skipping to change at page 68, line 22 skipping to change at page 62, line 16
"continue": { "continue": {
"access_token": { "access_token": {
"value": "33OMUKMKSKU80UPRY5NM", "value": "33OMUKMKSKU80UPRY5NM",
"key": true "key": true
}, },
"uri": "https://server.example.com/continue", "uri": "https://server.example.com/continue",
"wait": 30 "wait": 30
} }
} }
[[ Editor's note: Do we want to be more precise about what's expected [[ See issue #90 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
inside the "continue" object? I think that at least the URI is issues/90) ]]
required, access token required IF used, etc. This is even if they
haven't changed since last time, and the client will use whatever
value comes back. ]]
[[ Editor's note: extensions to this might need to communicate to the [[ See issue #91 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
client what the current state of the user interaction is. This has issues/91) ]]
been done in similar proprietary protocols, but the details of that
information tend to be highly application specific. Like "user
hasn't logged in yet", "user has logged in but is still sitting at
the page", or "user seems to have wandered off". We might be able to
provide a decent framework for hanging this kind of stuff on. ]]
If the request is successful in causing the AS to issue access tokens If the request is successful in causing the AS to issue access tokens
and release subject claims, the response could look like this and release subject claims, the response could look like this
example: example:
{ {
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L" "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L"
skipping to change at page 69, line 21 skipping to change at page 63, line 8
request. request.
The RC MAY include the "resources" and "subject" fields as described The RC MAY include the "resources" and "subject" fields as described
in Section 2.1 and Section 2.2. Inclusion of these fields override in Section 2.1 and Section 2.2. Inclusion of these fields override
any values in the initial request, which MAY trigger additional any values in the initial request, which MAY trigger additional
requirements and policies by the AS. For example, if the RC is requirements and policies by the AS. For example, if the RC is
asking for more access, the AS could require additional interaction asking for more access, the AS could require additional interaction
with the RO to gather additional consent. If the RC is asking for with the RO to gather additional consent. If the RC is asking for
more limited access, the AS could determine that sufficient more limited access, the AS could determine that sufficient
authorization has been granted to the RC and return the more limited authorization has been granted to the RC and return the more limited
access rights immediately. [[ Editor's note: We could state access rights immediately. [[ See issue #92 (https://github.com/
something like "resources and subject MUST NOT be the same as in the ietf-wg-gnap/gnap-core-protocol/issues/92) ]]
initial or previous request" to enforce that this really is a change,
but is there value in calling that out here? Somehow we do probably
want to tell the AS to not let a client simply post the same request
here to rotate access tokens now that we've got an explicit function
for that, right? ]]
The RC MAY include the "interact" field as described in Section 2.5. The RC MAY include the "interact" field as described in Section 2.5.
Inclusion of this field indicates that the RC is capable of driving Inclusion of this field indicates that the RC is capable of driving
interaction with the RO, and this field replaces any values from a interaction with the RO, and this field replaces any values from a
previous request. The AS MAY respond to any of the interaction previous request. The AS MAY respond to any of the interaction
responses as described in Section 3.3, just like it would to a new responses as described in Section 3.3, just like it would to a new
request. request.
The RC MAY include the "user" field as described in Section 2.4 to The RC MAY include the "user" field as described in Section 2.4 to
present new assertions or information about the RQ. [[ Editor's note: present new assertions or information about the RQ. [[ See issue #93
This would allow the client to do things like gather the user's (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/93) ]]
identifiers post-request, or gather an assertion from an on-device
element that the AS can verify. It opens up potential avenues for
trouble if the user here is different from the RO that's already
showed up at the AS or race conditions if the RQ's identity changes
mid-stream. But that said, this seems important for multi-log-in
cases and the like, probably. ]]
The RC MUST NOT include the "client" section of the request. [[ The RC MUST NOT include the "client" section of the request. [[ See
Editor's note: We do not want the client to be able to get swapped issue #94 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
out from underneath the user, especially post-consent. However, issues/94) ]]
including this field in a PATCH update request might be the place to
define key rotation for the grant request itself, but we'd need to be
very careful of how that works. And it feels like it might have
consequences outside of the request, such as rotating the key for all
ongoing grants for a given client instance, which isn't really
desirable here. We need a lot more discussion and engineering on
this before including it. ]]
The RC MAY include post-interaction responses such as described in The RC MAY include post-interaction responses such as described in
Section 5.1. [[ Editor's note: it seems a little odd to include this Section 5.1. [[ See issue #95 (https://github.com/ietf-wg-gnap/gnap-
in a request but I can't see a reason to not allow it. ]] core-protocol/issues/95) ]]
Modification requests MUST NOT alter previously-issued access tokens. Modification requests MUST NOT alter previously-issued access tokens.
Instead, any access tokens issued from a continuation are considered Instead, any access tokens issued from a continuation are considered
new, separate access tokens. The AS MAY revoke existing access new, separate access tokens. The AS MAY revoke existing access
tokens after a modification has occurred. [[ Editor's note: this tokens after a modification has occurred. [[ See issue #96
might be subject to the "multi_token" flag, but since we're creating (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/96) ]]
a NEW access token and not rotating an existing one, this seems to be
a different use case. ]]
Modification requests MAY result in previously-issued access tokens
being revoked. [[ Editor's note: there is a solid argument to be made
for always revoking old access tokens here, but we need more
discussion on the boundaries for such a requirement. If they stick
around, it does make a "read" request weird because now we've got
multiple access tokens sticking around associated with a grant
request and no good place to put them. ]]
If the modified request can be granted immediately by the AS, the If the modified request can be granted immediately by the AS, the
Section 3 MAY contain any newly-created access tokens (Section 3.2) Section 3 MAY contain any newly-created access tokens (Section 3.2)
or newly-released subject claims (Section 3.4). The response MAY or newly-released subject claims (Section 3.4). The response MAY
contain a new "continue" response (Section 3.1) as described above. contain a new "continue" response (Section 3.1) as described above.
If interaction can occur, the response SHOULD contain interaction If interaction can occur, the response SHOULD contain interaction
responses (Section 3.3) as well. responses (Section 3.3) as well.
For example, an RC initially requests a set of resources using For example, an RC initially requests a set of resources using
references: references:
skipping to change at page 74, line 5 skipping to change at page 66, line 51
later realizes that it now needs "write" access in addition to the later realizes that it now needs "write" access in addition to the
"read" access. Since this is an expansion of what it asked for "read" access. Since this is an expansion of what it asked for
previously, the RC also includes a new interaction section in case previously, the RC also includes a new interaction section in case
the AS needs to interact with the RO again to gather additional the AS needs to interact with the RO again to gather additional
authorization. Note that the RC's nonce and callback are different authorization. Note that the RC's nonce and callback are different
from the initial request. Since the original callback was already from the initial request. Since the original callback was already
used in the initial exchange, and the callback is intended for one- used in the initial exchange, and the callback is intended for one-
time-use, a new one needs to be included in order to use the callback time-use, a new one needs to be included in order to use the callback
again. again.
[[ Editor's note: the net result of this is that interaction requests [[ See issue #97 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
are really only meant to be responded to exactly once by the AS. issues/97) ]]
This isn't spelled out explicitly, but could be included in
Section 2.5 and/or Section 3.3. ]]
PATCH /continue HTTP/1.1 PATCH /continue HTTP/1.1
Host: server.example.com Host: server.example.com
Content-type: application/json Content-type: application/json
Authorization: GNAP 80UPRY5NM33OMUKMKSKU Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
{ {
"resources": [ "resources": [
"read", "write" "read", "write"
], ],
skipping to change at page 75, line 17 skipping to change at page 68, line 11
Content-type: application/json Content-type: application/json
Authorization: GNAP 80UPRY5NM33OMUKMKSKU Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
The response MAY include any fields described Section 3 that are The response MAY include any fields described Section 3 that are
applicable to this ongoing request, including the most recently applicable to this ongoing request, including the most recently
issued access tokens, any released subject claims, and any currently issued access tokens, any released subject claims, and any currently
active interaction modes. The response MAY contain a new "continue" active interaction modes. The response MAY contain a new "continue"
response (Section 3.1) as described above. response (Section 3.1) as described above.
[[ Editor's note: I'm a little dubious about the need for this [[ See issue #98 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
particular function in reality, but including it for completeness issues/98) ]]
sake. There are a lot of questions we need to answer, such as
whether it's safe to include access tokens and claims in the response
of this kind of "read" at all, and whether it makes sense to include
items like interaction nonces in the response. This discussion
should be driven by the use cases calling for this "read"
functionality. There have been similar functions within proprietary
protocols where the client calls an endpoint at the AS to figure out
where the user is in the interaction process at the AS, letting the
client provide a smarter UI. It doesn't seem like we could do that
in depth here since it would be highly application specific, but that
might be a good example of how to extend a response and give a client
extra information. ]]
5.5. Canceling a Grant Request 5.5. Canceling a Grant Request
If the RC wishes to cancel an ongoing grant request, it makes an HTTP If the RC wishes to cancel an ongoing grant request, it makes an HTTP
DELETE request to the continuation URI. DELETE request to the continuation URI.
DELETE /continue HTTP/1.1 DELETE /continue HTTP/1.1
Host: server.example.com Host: server.example.com
Content-type: application/json Content-type: application/json
Authorization: GNAP 80UPRY5NM33OMUKMKSKU Authorization: GNAP 80UPRY5NM33OMUKMKSKU
skipping to change at page 76, line 21 skipping to change at page 69, line 5
(Section 7). (Section 7).
If the token is a bearer token, the RC MUST present proof of the same If the token is a bearer token, the RC MUST present proof of the same
key identified in the initial request (Section 2.3.2) as described in key identified in the initial request (Section 2.3.2) as described in
Section 8. Section 8.
The AS MUST validate the proof and assure that it is associated with The AS MUST validate the proof and assure that it is associated with
either the token itself or the RC the token was issued to, as either the token itself or the RC the token was issued to, as
appropriate for the token's presentation type. appropriate for the token's presentation type.
[[ Editor's note: Should we allow for "update" to an access token by [[ See issue #99 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
the client posting new information from a "request"? It seems this issues/99) ]]
might make things weird since an access token is generally considered
an unchanging thing, and the client could always request a new access
token if they're allowed to continue the grant request post-issuance
as in Section 5.3. There's also a possibility of being able to
"read" a token's state with a GET, much like token introspection but
using the token's/client's key instead of the RS key. But would a
client need to "read" a token state after issuance? Is there a
security risk to offering that functionality? Introspection is
nearly always relegated to RS calls in practice since the client is
focused on using the token at the RS. The client can always read the
state of the grant itself, separately. ]]
6.1. Rotating the Access Token 6.1. Rotating the Access Token
The RC makes an HTTP POST to the token management URI, sending the The RC makes an HTTP POST to the token management URI, sending the
access token in the appropriate header and signing the request with access token in the appropriate header and signing the request with
the appropriate key. the appropriate key.
POST /token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L HTTP/1.1 POST /token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: GNAP OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0 Authorization: GNAP OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0
Detached-JWS: eyj0.... Detached-JWS: eyj0....
[[ Editor's note: This could alternatively be an HTTP PUT verb, since [[ See issue #100 (https://github.com/ietf-wg-gnap/gnap-core-
we are telling the AS that we want to replace the token. However, we protocol/issues/100) ]]
are not providing the information we want to replace the token with,
and in fact that's up to the AS entirely, not the client. For that
reason, I think a POST still makes the most sense. ]]
The AS validates that the token presented is associated with the The AS validates that the token presented is associated with the
management URL, that the AS issued the token to the given RC, and management URL, that the AS issued the token to the given RC, and
that the presented key is appropriate to the token. that the presented key is appropriate to the token.
If the access token has expired, the AS SHOULD honor the rotation If the access token has expired, the AS SHOULD honor the rotation
request to the token management URL since it is likely that the RC is request to the token management URL since it is likely that the RC is
attempting to refresh the expired token. To support this, the AS MAY attempting to refresh the expired token. To support this, the AS MAY
apply different lifetimes for the use of the token in management vs. apply different lifetimes for the use of the token in management vs.
its use at an RS. An AS MUST NOT honor a rotation request for an its use at an RS. An AS MUST NOT honor a rotation request for an
access token that has been revoked, either by the AS or by the RC access token that has been revoked, either by the AS or by the RC
through the token management URI (Section 6.2). through the token management URI (Section 6.2).
If the token is validated and the key is appropriate for the request, If the token is validated and the key is appropriate for the request,
the AS MUST invalidate the current access token associated with this the AS MUST invalidate the current access token associated with this
URL, if possible, and return a new access token response as described URL, if possible, and return a new access token response as described
in Section 3.2.1, unless the "multi_token" flag is specified in the in Section 3.2.1, unless the "multi_token" flag is specified in the
request. [[ Editor's note: We could also use different verbs to request. The value of the access token MUST NOT be the same as the
signal whether or not the old token should be kept around or not, current value of the access token used to access the management API.
instead of using a token flag to do this. ]] The value of the access The response MAY include an updated access token management URL as
token MUST NOT be the same as the current value of the access token well, and if so, the RC MUST use this new URL to manage the new
used to access the management API. The response MAY include an access token. [[ See issue #101 (https://github.com/ietf-wg-gnap/
updated access token management URL as well, and if so, the RC MUST gnap-core-protocol/issues/101) ]]
use this new URL to manage the new access token.
[[ Editor's note: the net result is that the client's always going to [[ See issue #102 (https://github.com/ietf-wg-gnap/gnap-core-
use the management URL that comes back. But should we let the server protocol/issues/102) ]]
omit it from the response if it doesn't change? That seems like an
odd optimization that doesn't help the client. ]]
{ {
"access_token": { "access_token": {
"value": "FP6A8H6HY37MH13CK76LBZ6Y1UADG6VEUPEER5H2", "value": "FP6A8H6HY37MH13CK76LBZ6Y1UADG6VEUPEER5H2",
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L", "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L",
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
skipping to change at page 78, line 32 skipping to change at page 70, line 32
"datatypes": [ "datatypes": [
"metadata", "metadata",
"images" "images"
] ]
}, },
"read", "dolphin-metadata" "read", "dolphin-metadata"
] ]
} }
} }
[[ Editor's note: If the client is using its own key as the proof, [[ See issue #103 (https://github.com/ietf-wg-gnap/gnap-core-
like with a bearer access token, the AS is going to need to know if protocol/issues/103) ]]
the client's key has been rotated. We don't have a mechanism for
rotating the token's key or the client's key yet either - so that
could occur through this management function as well. ]]
6.2. Revoking the Access Token 6.2. Revoking the Access Token
If the RC wishes to revoke the access token proactively, such as when If the RC wishes to revoke the access token proactively, such as when
a user indicates to the RC that they no longer wish for it to have a user indicates to the RC that they no longer wish for it to have
access or the RC application detects that it is being uninstalled, access or the RC application detects that it is being uninstalled,
the RC can use the token management URI to indicate to the AS that the RC can use the token management URI to indicate to the AS that
the AS should invalidate the access token for all purposes. the AS should invalidate the access token for all purposes.
The RC makes an HTTP DELETE request to the token management URI, The RC makes an HTTP DELETE request to the token management URI,
skipping to change at page 80, line 5 skipping to change at page 71, line 46
If the "key" value is an object, the value of the "proof" field If the "key" value is an object, the value of the "proof" field
within the key indicates the particular proofing mechanism to use. within the key indicates the particular proofing mechanism to use.
The access token is sent using the HTTP authorization scheme "GNAP" The access token is sent using the HTTP authorization scheme "GNAP"
along with a key proof as described in Section 8 for the key bound to along with a key proof as described in Section 8 for the key bound to
the access token. For example, a "jwsd"-bound access token is sent the access token. For example, a "jwsd"-bound access token is sent
as follows: as follows:
Authorization: GNAP OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0 Authorization: GNAP OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0
Detached-JWS: eyj0.... Detached-JWS: eyj0....
[[ Editor's note: I don't actually like the idea of using only one [[ See issue #104 (https://github.com/ietf-wg-gnap/gnap-core-
header type for differently-bound access tokens. Perhaps instead protocol/issues/104) ]]
these values should somehow reflect the key binding types. Maybe
there can be multiple fields after the "GNAP" keyword using
structured headers? Or a set of derived headers like GNAP-mtls?
This might also be better as a separate specification, like it was in
OAuth 2. However, access tokens should be able to use any key
binding mechanisms here, plus bearer. ]]
8. Binding Keys 8. Binding Keys
Any keys presented by the RC to the AS or RS MUST be validated as Any keys presented by the RC to the AS or RS MUST be validated as
part of the request in which they are presented. The type of binding part of the request in which they are presented. The type of binding
used is indicated by the proof parameter of the key section in the used is indicated by the proof parameter of the key section in the
initial request Section 2.3.2. Values defined by this specification initial request Section 2.3.2. Values defined by this specification
are as follows: are as follows:
jwsd A detached JWS signature header jwsd A detached JWS signature header
skipping to change at page 80, line 47 skipping to change at page 72, line 38
All key binding methods used by this specification MUST cover all All key binding methods used by this specification MUST cover all
relevant portions of the request, including anything that would relevant portions of the request, including anything that would
change the nature of the request, to allow for secure validation of change the nature of the request, to allow for secure validation of
the request by the AS. Relevant aspects include the URI being the request by the AS. Relevant aspects include the URI being
called, the HTTP method being used, any relevant HTTP headers and called, the HTTP method being used, any relevant HTTP headers and
values, and the HTTP message body itself. The recipient of the values, and the HTTP message body itself. The recipient of the
signed message MUST validate all components of the signed message to signed message MUST validate all components of the signed message to
ensure that nothing has been tampered with or substituted in a way ensure that nothing has been tampered with or substituted in a way
that would change the nature of the request. that would change the nature of the request.
When used in the GNAP delegation protocol, these key binding When used for delegation in GNAP, these key binding mechanisms allow
mechanisms allow the AS to ensure that the keys presented by the RC the AS to ensure that the keys presented by the RC in the initial
in the initial request are in control of the party calling any request are in control of the party calling any follow-up or
follow-up or continuation requests. To facilitate this requirement, continuation requests. To facilitate this requirement, all keys in
all keys in the initial request Section 2.3.2 MUST be proved in all the initial request Section 2.3.2 MUST be proved in all continuation
continuation requests Section 5 and token management requests requests Section 5 and token management requests Section 6, modulo
Section 6, modulo any rotations on those keys over time that the AS any rotations on those keys over time that the AS knows about. The
knows about. The AS MUST validate all keys presented by the RC AS MUST validate all keys presented by the RC (Section 2.3.2) or
(Section 2.3.2) or referenced in an ongoing request for each call referenced in an ongoing request for each call within that request.
within that request.
[[ Editor's note: We are going to need a way for a client to rotate [[ See issue #105 (https://github.com/ietf-wg-gnap/gnap-core-
its keys securely, even while an ongoing grant is in effect. ]] protocol/issues/105) ]]
When used to bind to an access token, the When used to bind to an access token, the access token MUST be
covered by the signature method.
8.1. Detached JWS 8.1. Detached JWS
This method is indicated by "jwsd" in the "proof" field. A JWS This method is indicated by "jwsd" in the "proof" field. A JWS
[RFC7515] signature object is created as follows: [RFC7515] signature object is created as follows:
The header of the JWS MUST contain the "kid" field of the key bound The header of the JWS MUST contain the "kid" field of the key bound
to this RC for this request. The JWS header MUST contain an "alg" to this RC for this request. The JWS header MUST contain an "alg"
field appropriate for the key identified by kid and MUST NOT be field appropriate for the key identified by kid and MUST NOT be
"none". The "b64" field MUST be set to "false" and the "crit" field "none". The "b64" field MUST be set to "false" and the "crit" field
MUST contain at least "b64" as specified in [RFC7797] MUST contain at least "b64" as specified in [RFC7797]
To protect the request, the JWS header MUST contain the following To protect the request, the JWS header MUST contain the following
additional fields. additional fields.
htm The HTTP Method used to make this request, as an uppercase ASCII htm (string) The HTTP Method used to make this request, as an
string. uppercase ASCII string.
htu The HTTP URI used for this request, including all path and query htu (string) The HTTP URI used for this request, including all path
components. and query components.
ts A timestamp of the request in integer seconds ts (integer) A timestamp of the request in integer seconds
at_hash When to bind a request to an access token, the access token at_hash (string) When to bind a request to an access token, the
hash value. Its value is the base64url encoding of the left-most access token hash value. Its value is the base64url encoding of
half of the hash of the octets of the ASCII representation of the the left-most half of the hash of the octets of the ASCII
"access_token" value, where the hash algorithm used is the hash representation of the "access_token" value, where the hash
algorithm used in the "alg" header parameter of the JWS's JOSE algorithm used is the hash algorithm used in the "alg" header
Header. For instance, if the "alg" is "RS256", hash the parameter of the JWS's JOSE Header. For instance, if the "alg" is
"access_token" value with SHA-256, then take the left-most 128 "RS256", hash the "access_token" value with SHA-256, then take the
bits and base64url encode them. left-most 128 bits and base64url encode them.
[[ See issue #106 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/106) ]]
[[ Editor's note: It's not the usual practice to put additional
information into the header of a JWS, but this keeps us from having
to normalize the body serialization. Alternatively, we could add all
these fields to the body of the request, but then it gets awkward for
non-body requests like GET/DELETE. ]]
The payload of the JWS object is the serialized body of the request, The payload of the JWS object is the serialized body of the request,
and the object is signed according to detached JWS [RFC7797]. and the object is signed according to detached JWS [RFC7797].
The RC presents the signature in the Detached-JWS HTTP Header field. The RC presents the signature in the Detached-JWS HTTP Header field.
[[ Editor's Note: this is a custom header field, do we need this? It [[ See issue #107 (https://github.com/ietf-wg-gnap/gnap-core-
seems like the best place to put this. ]] protocol/issues/107) ]]
POST /tx HTTP/1.1 POST /tx HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/json Content-Type: application/json
Detached-JWS: eyJiNjQiOmZhbHNlLCJhbGciOiJSUzI1NiIsImtpZCI6Inh5ei0xIn0. Detached-JWS: eyJiNjQiOmZhbHNlLCJhbGciOiJSUzI1NiIsImtpZCI6Inh5ei0xIn0.
.Y287HMtaY0EegEjoTd_04a4GC6qV48GgVbGKOhHdJnDtD0VuUlVjLfwne8AuUY3U7e8 .Y287HMtaY0EegEjoTd_04a4GC6qV48GgVbGKOhHdJnDtD0VuUlVjLfwne8AuUY3U7e8
9zUWwXLnAYK_BiS84M8EsrFvmv8yDLWzqveeIpcN5_ysveQnYt9Dqi32w6IOtAywkNUD 9zUWwXLnAYK_BiS84M8EsrFvmv8yDLWzqveeIpcN5_ysveQnYt9Dqi32w6IOtAywkNUD
ZeJEdc3z5s9Ei8qrYFN2fxcu28YS4e8e_cHTK57003WJu-wFn2TJUmAbHuqvUsyTb-nz ZeJEdc3z5s9Ei8qrYFN2fxcu28YS4e8e_cHTK57003WJu-wFn2TJUmAbHuqvUsyTb-nz
YOKxuCKlqQItJF7E-cwSb_xULu-3f77BEU_vGbNYo5ZBa2B7UHO-kWNMSgbW2yeNNLbL YOKxuCKlqQItJF7E-cwSb_xULu-3f77BEU_vGbNYo5ZBa2B7UHO-kWNMSgbW2yeNNLbL
C18Kv80GF22Y7SbZt0e2TwnR2Aa2zksuUbntQ5c7a1-gxtnXzuIKa34OekrnyqE1hmVW C18Kv80GF22Y7SbZt0e2TwnR2Aa2zksuUbntQ5c7a1-gxtnXzuIKa34OekrnyqE1hmVW
skipping to change at page 84, line 13 skipping to change at page 75, line 13
} }
If the request being made does not have a message body, such as an If the request being made does not have a message body, such as an
HTTP GET, OPTIONS, or DELETE method, the JWS signature is calculated HTTP GET, OPTIONS, or DELETE method, the JWS signature is calculated
over an empty payload. over an empty payload.
When the server (AS or RS) receives the Detached-JWS header, it MUST When the server (AS or RS) receives the Detached-JWS header, it MUST
parse its contents as a detached JWS object. The HTTP Body is used parse its contents as a detached JWS object. The HTTP Body is used
as the payload for purposes of validating the JWS, with no as the payload for purposes of validating the JWS, with no
transformations. transformations.
[[ Editor's note: this is a potentially fragile signature mechanism. [[ See issue #108 (https://github.com/ietf-wg-gnap/gnap-core-
It doesn't protect arbitrary headers or other specific aspects of the protocol/issues/108) ]]
request, but it's simple to calculate and useful for body-driven
requests, like the client to the AS. Additionally it is potentially
fragile since a multi-tier system could parse the payload and pass
the parsed payload downstream with potential transformations, making
downstream signature validation impossible. We might want to remove
this in favor of general-purpose HTTP signing, or at least provide
guidance on its use. ]]
8.2. Attached JWS 8.2. Attached JWS
This method is indicated by "jws" in the "proof" field. A JWS This method is indicated by "jws" in the "proof" field. A JWS
[RFC7515] signature object is created as follows: [RFC7515] signature object is created as follows:
The header of the JWS MUST contain the "kid" field of the key bound The header of the JWS MUST contain the "kid" field of the key bound
to this RC for this request. The JWS header MUST contain an "alg" to this RC for this request. The JWS header MUST contain an "alg"
field appropriate for the key identified by kid and MUST NOT be field appropriate for the key identified by kid and MUST NOT be
"none". "none".
To protect the request, the JWS header MUST contain the following To protect the request, the JWS header MUST contain the following
additional fields. additional fields.
htm The HTTP Method used to make this request, as an uppercase ASCII htm (string) The HTTP Method used to make this request, as an
string. uppercase ASCII string.
htu The HTTP URI used for this request, including all path and query htu (string) The HTTP URI used for this request, including all path
components. and query components.
ts A timestamp of the request in integer seconds ts (integer) A timestamp of the request in integer seconds
at_hash When to bind a request to an access token, the access token at_hash (string) When to bind a request to an access token, the
hash value. Its value is the base64url encoding of the left-most access token hash value. Its value is the base64url encoding of
half of the hash of the octets of the ASCII representation of the the left-most half of the hash of the octets of the ASCII
"access_token" value, where the hash algorithm used is the hash representation of the "access_token" value, where the hash
algorithm used in the "alg" header parameter of the JWS's JOSE algorithm used is the hash algorithm used in the "alg" header
Header. For instance, if the "alg" is "RS256", hash the parameter of the JWS's JOSE Header. For instance, if the "alg" is
"access_token" value with SHA-256, then take the left-most 128 "RS256", hash the "access_token" value with SHA-256, then take the
bits and base64url encode them. left-most 128 bits and base64url encode them.
[[ Editor's note: It's not the usual practice to put additional [[ See issue #107 (https://github.com/ietf-wg-gnap/gnap-core-
information into the header of a JWS, but this keeps us from having protocol/issues/107) ]]
to modify the body to use this signature method. Alternatively, we
could add all these fields to the body of the request, but then it
gets awkward for non-body requests like GET/DELETE. ]]
The payload of the JWS object is the JSON serialized body of the The payload of the JWS object is the JSON serialized body of the
request, and the object is signed according to JWS and serialized request, and the object is signed according to JWS and serialized
into compact form [RFC7515]. into compact form [RFC7515].
The RC presents the JWS as the body of the request along with a The RC presents the JWS as the body of the request along with a
content type of "application/jose". The AS MUST extract the payload content type of "application/jose". The AS MUST extract the payload
of the JWS and treat it as the request body for further processing. of the JWS and treat it as the request body for further processing.
POST /tx HTTP/1.1 POST /tx HTTP/1.1
skipping to change at page 88, line 5 skipping to change at page 78, line 5
{ {
"alg": "RS256", "alg": "RS256",
"kid": "KAgNpWbRyy9Mf2rikl498LThMrvkbZWHVSQOBC4VHU4", "kid": "KAgNpWbRyy9Mf2rikl498LThMrvkbZWHVSQOBC4VHU4",
"htm": "post", "htm": "post",
"htu": "/tx", "htu": "/tx",
"ts": 1603800783 "ts": 1603800783
} }
And the JWS body decodes to: And the JWS body decodes to:
{ {
"capabilities": [], "capabilities": [],
"client": { "client": {
"key": { "key": {
"jwk": { "jwk": {
"kty": "RSA", "kty": "RSA",
"e": "AQAB", "e": "AQAB",
"kid": "KAgNpWbRyy9Mf2rikl498LThMrvkbZWHVSQOBC4VHU4", "kid": "KAgNpWbRyy9Mf2rikl498LThMrvkbZWHVSQOBC4VHU4",
"n": "llWmHF8XA2KNLdmxOP3kxD9OY76p0Sr37jfhz94a93xm2FNqoSPcRZAPd0lqDS8N3Uia53dB23Z59OwY4bpM_Vf8GJvvptLWnxo1PyhmPr-ecdSCRQdTc_ZcMF4hRV48qqlvuD0mqtcDbIkSBDvccJmZHwfTpDHinT8ttvcVP8VkAMAq4kVazxOpMoIRsoyEp_eCe5pSwqHo0daCWNKR-EpKm6NiOtedF4Oumt8NLKTVjfYgFHeBDdCbrrETd4vBMwDtAnjPr3CVCwwx2bAQT6SlxFJ3fj2hhyIpq7pc8rZib5jNyXKwfBukTVYZozksht-LohyASaKpYTp8LtNZ-w" "n": "llWmHF8XA2KNLdmxOP3kxD9OY76p0Sr37jfhz94a93xm2FNqoSPc
}, RZAPd0lqDS8N3Uia53dB23Z59OwY4bpM_Vf8GJvvptLWnxo1PyhmPr-ecd
"proof": "jws" SCRQdTc_ZcMF4hRV48qqlvuD0mqtcDbIkSBDvccJmZHwfTpDHinT8ttvcV
}, P8VkAMAq4kVazxOpMoIRsoyEp_eCe5pSwqHo0daCWNKR-EpKm6NiOtedF4
"name": "My Fist Client", Oumt8NLKTVjfYgFHeBDdCbrrETd4vBMwDtAnjPr3CVCwwx2bAQT6SlxFJ3
"uri": "http://localhost/client/clientID" fj2hhyIpq7pc8rZib5jNyXKwfBukTVYZozksht-LohyASaKpYTp8LtNZ-w"
}, },
"interact": { "proof": "jws"
"callback": { },
"method": "redirect", "name": "My Fist Client",
"nonce": "d90213884b840920538b5c51", "uri": "http://localhost/client/clientID"
"uri": "http://localhost/client/request-done" },
}, "interact": {
"redirect": true "callback": {
}, "method": "redirect",
"resources": { "nonce": "d90213884b840920538b5c51",
"actions": [ "uri": "http://localhost/client/request-done"
"read", },
"print" "redirect": true
], },
"locations": [ "resources": {
"http://localhost/photos" "actions": [
], "read",
"type": "photo-api" "print"
}, ],
"subject": { "locations": [
"sub_ids": [ "http://localhost/photos"
"iss-sub", ],
"email" "type": "photo-api"
] },
} "subject": {
} "sub_ids": [
"iss_sub",
"email"
]
}
}
If the request being made does not have a message body, such as an If the request being made does not have a message body, such as an
HTTP GET, OPTIONS, or DELETE method, the JWS signature is calculated HTTP GET, OPTIONS, or DELETE method, the JWS signature is calculated
over an empty payload and passed in the "Detached-JWS" header as over an empty payload and passed in the "Detached-JWS" header as
described in Section 8.1. described in Section 8.1.
[[ Editor's note: A downside to this method is that it requires the [[ See issue #109 (https://github.com/ietf-wg-gnap/gnap-core-
content type to be something other than application/json, and it protocol/issues/109) ]]
doesn't work against an RS without additional profiling since it
takes over the request body - plus we have to specify different
delivery locations for a GET vs. a POST, for example. Additionally
it is potentially fragile like a detached JWS since a multi-tier
system could parse the payload and pass the parsed payload downstream
with potential transformations. We might want to remove this in
favor of general-purpose HTTP signing, or at least provide guidance
on its use. ]]
8.3. Mutual TLS 8.3. Mutual TLS
This method is indicated by "mtls" in the "proof" field. The RC This method is indicated by "mtls" in the "proof" field. The RC
presents its client certificate during TLS negotiation with the presents its client certificate during TLS negotiation with the
server (either AS or RS). The AS or RS takes the thumbprint of the server (either AS or RS). The AS or RS takes the thumbprint of the
client certificate presented during mutual TLS negotiation and client certificate presented during mutual TLS negotiation and
compares that thumbprint to the thumbprint presented by the RC compares that thumbprint to the thumbprint presented by the RC
application as described in [RFC8705] section 3. application as described in [RFC8705] section 3.
skipping to change at page 90, line 46 skipping to change at page 80, line 43
xzY2xpZW50QGJzcGsuaW+GF2h0dHA6Ly90bHNjbGllbnQubG9jYWwvhhNzc2g6dGx xzY2xpZW50QGJzcGsuaW+GF2h0dHA6Ly90bHNjbGllbnQubG9jYWwvhhNzc2g6dGx
zY2xpZW50LmxvY2FsMA0GCSqGSIb3DQEBCwUAA4IBAQCKKv8WlLrT4Z5NazaUrYtl zY2xpZW50LmxvY2FsMA0GCSqGSIb3DQEBCwUAA4IBAQCKKv8WlLrT4Z5NazaUrYtl
TF+2v0tvZBQ7qzJQjlOqAcvxry/d2zyhiRCRS/v318YCJBEv4Iq2W3I3JMMyAYEe2 TF+2v0tvZBQ7qzJQjlOqAcvxry/d2zyhiRCRS/v318YCJBEv4Iq2W3I3JMMyAYEe2
573HzT7rH3xQP12yZyRQnetdiVM1Z1KaXwfrPDLs72hUeELtxIcfZ0M085jLboXhu 573HzT7rH3xQP12yZyRQnetdiVM1Z1KaXwfrPDLs72hUeELtxIcfZ0M085jLboXhu
fHI6kqm3NCyCCTihe2ck5RmCc5l2KBO/vAHF0ihhFOOOby1v6qbPHQcxAU6rEb907 fHI6kqm3NCyCCTihe2ck5RmCc5l2KBO/vAHF0ihhFOOOby1v6qbPHQcxAU6rEb907
/p6BW/LV1NCgYB1QtFSfGxowqb9FRIMD2kvMSmO0EMxgwZ6k6spa+jk0IsI3klwLW /p6BW/LV1NCgYB1QtFSfGxowqb9FRIMD2kvMSmO0EMxgwZ6k6spa+jk0IsI3klwLW
9b+Tfn/daUbIDctxeJneq2anQyU2znBgQl6KILDSF4eaOqlBut/KNZHHazJh" 9b+Tfn/daUbIDctxeJneq2anQyU2znBgQl6KILDSF4eaOqlBut/KNZHHazJh"
} }
} }
[[ Editor's note: This method requires no changes to the HTTP message [[ See issue #110 (https://github.com/ietf-wg-gnap/gnap-core-
itself, since the security relies on the TLS layer. However, the protocol/issues/110) ]]
application level will need to validate that the certificate key used
in the request is the one expected for the specific request. ]]
8.4. Demonstration of Proof-of-Possession (DPoP) 8.4. Demonstration of Proof-of-Possession (DPoP)
This method is indicated by "dpop" in the "proof" field. The RC This method is indicated by "dpop" in the "proof" field. The RC
creates a Demonstration of Proof-of-Possession signature header as creates a Demonstration of Proof-of-Possession signature header as
described in [I-D.ietf-oauth-dpop] section 2. In addition to the described in [I-D.ietf-oauth-dpop] section 2. In addition to the
required fields, the DPoP body MUST also contain a digest of the required fields, the DPoP body MUST also contain a digest of the
request body: request body:
digest Digest of the request body as the value of the Digest header digest (string) Digest of the request body as the value of the
defined in [RFC3230]. Digest header defined in [RFC3230].
POST /tx HTTP/1.1 POST /tx HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/json Content-Type: application/json
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IlJTMjU2IiwiandrIjp7Imt0eSI6Il DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IlJTMjU2IiwiandrIjp7Imt0eSI6Il
JTQSIsImUiOiJBUUFCIiwia2lkIjoieHl6LWNsaWVudCIsImFsZyI6IlJTMjU2Iiwibi JTQSIsImUiOiJBUUFCIiwia2lkIjoieHl6LWNsaWVudCIsImFsZyI6IlJTMjU2Iiwibi
I6Inp3Q1RfM2J4LWdsYmJIcmhlWXBZcFJXaVk5SS1uRWFNUnBablJySWpDczZiX2VteV I6Inp3Q1RfM2J4LWdsYmJIcmhlWXBZcFJXaVk5SS1uRWFNUnBablJySWpDczZiX2VteV
RrQmtEREVqU3lzaTM4T0M3M2hqMS1XZ3hjUGRLTkdaeUlvSDNRWmVuMU1LeXloUXBMSk RrQmtEREVqU3lzaTM4T0M3M2hqMS1XZ3hjUGRLTkdaeUlvSDNRWmVuMU1LeXloUXBMSk
cxLW9MTkxxbTdwWFh0ZFl6U2RDOU8zLW9peXk4eWtPNFlVeU5aclJSZlBjaWhkUUNiT1 cxLW9MTkxxbTdwWFh0ZFl6U2RDOU8zLW9peXk4eWtPNFlVeU5aclJSZlBjaWhkUUNiT1
9PQzhRdWdtZzlyZ05ET1NxcHBkYU5lYXMxb3Y5UHhZdnhxcnoxLThIYTdna0QwMFlFQ1 9PQzhRdWdtZzlyZ05ET1NxcHBkYU5lYXMxb3Y5UHhZdnhxcnoxLThIYTdna0QwMFlFQ1
skipping to change at page 92, line 24 skipping to change at page 82, line 24
CCNaOKNJn_Oz0YhdHbXTeWO5AoyspDWJbN5w_7bdWDxgpD-y6jnD1u9YhBOCWObNPFvpkTM CCNaOKNJn_Oz0YhdHbXTeWO5AoyspDWJbN5w_7bdWDxgpD-y6jnD1u9YhBOCWObNPFvpkTM
8LC7SdXGRKx2k8Me2r_GssYlyRpqvpBlY5-ejCywKRBfctRcnhTTGNztbbDBUyDSWmFMVCH 8LC7SdXGRKx2k8Me2r_GssYlyRpqvpBlY5-ejCywKRBfctRcnhTTGNztbbDBUyDSWmFMVCH
e5mXT4cL0BwrZC6S-uu-LAx06aKwQOPwYOGOslK8WPm1yGdkaA1uF_FpS6LS63WYPHi_Ap2 e5mXT4cL0BwrZC6S-uu-LAx06aKwQOPwYOGOslK8WPm1yGdkaA1uF_FpS6LS63WYPHi_Ap2
B7_8Wbw4ttzbMS_doJvuDagW8A1Ip3fXFAHtRAcKw7rdI4_Xln66hJxFekpdfWdiPQddQ6Y B7_8Wbw4ttzbMS_doJvuDagW8A1Ip3fXFAHtRAcKw7rdI4_Xln66hJxFekpdfWdiPQddQ6Y
1cK2U3obvUg7w" 1cK2U3obvUg7w"
} }
} }
} }
} }
[[ Editor's note: this method requires duplication of the key in the [[ See issue #111 (https://github.com/ietf-wg-gnap/gnap-core-
header and the request body, which is redundant and potentially protocol/issues/111) ]]
awkward. The signature also doesn't protect the body of the request.
]]
8.5. HTTP Signing 8.5. HTTP Signing
This method is indicated by "httpsig" in the "proof" field. The RC This method is indicated by "httpsig" in the "proof" field. The RC
creates an HTTP Signature header as described in creates an HTTP Signature header as described in
[I-D.ietf-httpbis-message-signatures] section 4. The RC MUST [I-D.ietf-httpbis-message-signatures] section 4. The RC MUST
calculate and present the Digest header as defined in [RFC3230] and calculate and present the Digest header as defined in [RFC3230] and
include this header in the signature. include this header in the signature.
POST /tx HTTP/1.1 POST /tx HTTP/1.1
skipping to change at page 94, line 5 skipping to change at page 83, line 48
When used to present an access token as in Section 7, the When used to present an access token as in Section 7, the
Authorization header MUST be included in the signature. Authorization header MUST be included in the signature.
8.6. OAuth Proof of Possession (PoP) 8.6. OAuth Proof of Possession (PoP)
This method is indicated by "oauthpop" in the "proof" field. The RC This method is indicated by "oauthpop" in the "proof" field. The RC
creates an HTTP Authorization PoP header as described in creates an HTTP Authorization PoP header as described in
[I-D.ietf-oauth-signed-http-request] section 4, with the following [I-D.ietf-oauth-signed-http-request] section 4, with the following
additional requirements: additional requirements:
* The at (access token) field MUST be omitted unless this method is * The "at" (access token) field MUST be omitted unless this method
being used in conjunction with an access token as in Section 7. is being used in conjunction with an access token as in Section 7.
[[ Editor's note: this is in contradiction to the referenced spec [[ See issue #112 (https://github.com/ietf-wg-gnap/gnap-core-
which makes this field mandatory. ]] protocol/issues/112) ]]
* The b (body hash) field MUST be calculated and supplied, unless * The "b" (body hash) field MUST be calculated and supplied, unless
there is no entity body (such as a GET, OPTIONS, or DELETE there is no entity body (such as a GET, OPTIONS, or DELETE
request). request).
* All components of the URL MUST be calculated and supplied * All components of the URL MUST be calculated and supplied
* The m (method) field MUST be supplied * The m (method) field MUST be supplied
POST /tx HTTP/1.1 POST /tx HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/json Content-Type: application/json
skipping to change at page 95, line 31 skipping to change at page 85, line 26
y6jnD1u9YhBOCWObNPFvpkTM8LC7SdXGRKx2k8Me2r_GssYlyRpqvpBlY5- y6jnD1u9YhBOCWObNPFvpkTM8LC7SdXGRKx2k8Me2r_GssYlyRpqvpBlY5-
ejCywKRBfctRcnhTTGNztbbDBUyDSWmFMVCHe5mXT4cL0BwrZC6S-uu-LAx ejCywKRBfctRcnhTTGNztbbDBUyDSWmFMVCHe5mXT4cL0BwrZC6S-uu-LAx
06aKwQOPwYOGOslK8WPm1yGdkaA1uF_FpS6LS63WYPHi_Ap2B7_8Wbw4ttz 06aKwQOPwYOGOslK8WPm1yGdkaA1uF_FpS6LS63WYPHi_Ap2B7_8Wbw4ttz
bMS_doJvuDagW8A1Ip3fXFAHtRAcKw7rdI4_Xln66hJxFekpdfWdiPQddQ6 bMS_doJvuDagW8A1Ip3fXFAHtRAcKw7rdI4_Xln66hJxFekpdfWdiPQddQ6
Y1cK2U3obvUg7w" Y1cK2U3obvUg7w"
} }
} }
} }
} }
[[ Editor's note: This is a stale draft from the OAuth working group, [[ See issue #113 (https://github.com/ietf-wg-gnap/gnap-core-
but it does at least provide some basic functionality for protecting protocol/issues/113) ]]
HTTP messages with a signature. This work is likely to be subsumed
by the general-purpose HTTP message signature mechanism in
Section 8.5. ]]
9. Discovery 9. Discovery
By design, the protocol minimizes the need for any pre-flight By design, the protocol minimizes the need for any pre-flight
discovery. To begin a request, the RC only needs to know the discovery. To begin a request, the RC only needs to know the
endpoint of the AS and which keys it will use to sign the request. endpoint of the AS and which keys it will use to sign the request.
Everything else can be negotiated dynamically in the course of the Everything else can be negotiated dynamically in the course of the
protocol. protocol.
However, the AS can have limits on its allowed functionality. If the However, the AS can have limits on its allowed functionality. If the
RC wants to optimize its calls to the AS before making a request, it RC wants to optimize its calls to the AS before making a request, it
MAY send an HTTP OPTIONS request to the grant request endpoint to MAY send an HTTP OPTIONS request to the grant request endpoint to
retrieve the server's discovery information. The AS MUST respond retrieve the server's discovery information. The AS MUST respond
with a JSON document containing the following information: with a JSON document containing the following information:
grant_request_endpoint REQUIRED. The full URL of the AS's grant grant_request_endpoint (string) REQUIRED. The full URL of the AS's
request endpoint. This MUST match the URL the RC used to make the grant request endpoint. This MUST match the URL the RC used to
discovery request. make the discovery request.
capabilities OPTIONAL. A list of the AS's capabilities. The values
of this result MAY be used by the RC in the capabilities section
(Section 2.6) of the request.
interaction_methods OPTIONAL. A list of the AS's interaction capabilities (array of strings) OPTIONAL. A list of the AS's
methods. The values of this list correspond to the possible capabilities. The values of this result MAY be used by the RC in
fields in the interaction section (Section 2.5) of the request. the capabilities section (Section 2.6) of the request.
key_proofs OPTIONAL. A list of the AS's supported key proofing interaction_methods (array of strings) OPTIONAL. A list of the AS's
mechanisms. The values of this list correspond to possible values interaction methods. The values of this list correspond to the
of the "proof" field of the key section (Section 2.3.2) of the possible fields in the interaction section (Section 2.5) of the
request. request.
sub_ids OPTIONAL. A list of the AS's supported identifiers. The key_proofs (array strings) OPTIONAL. A list of the AS's supported
values of this list correspond to possible values of the subject key proofing mechanisms. The values of this list correspond to
identifier section (Section 2.2) of the request. possible values of the "proof" field of the key section
(Section 2.3.2) of the request.
assertions OPTIONAL. A list of the AS's supported assertion sub_ids (array of strings) OPTIONAL. A list of the AS's supported
formats. The values of this list correspond to possible values of identifiers. The values of this list correspond to possible
the subject assertion section (Section 2.2) of the request. values of the subject identifier section (Section 2.2) of the
request.
assertions (array of strings) OPTIONAL. A list of the AS's
supported assertion formats. The values of this list correspond
to possible values of the subject assertion section (Section 2.2)
of the request.
The information returned from this method is for optimization The information returned from this method is for optimization
purposes only. The AS MAY deny any request, or any portion of a purposes only. The AS MAY deny any request, or any portion of a
request, even if it lists a capability as supported. For example, a request, even if it lists a capability as supported. For example, a
given RC can be registered with the "mtls" key proofing mechanism, given RC can be registered with the "mtls" key proofing mechanism,
but the AS also returns other proofing methods, then the AS will deny but the AS also returns other proofing methods, then the AS will deny
a request from that RC using a different proofing mechanism. a request from that RC using a different proofing mechanism.
10. Resource Servers 10. Resource Servers
In some deployments, a resource server will need to be able to call In some deployments, a resource server will need to be able to call
the AS for a number of functions. the AS for a number of functions.
[[ Editor's note: This section is for discussion of possible advanced [[ See issue #114 (https://github.com/ietf-wg-gnap/gnap-core-
functionality. It seems like it should be a separate document or set protocol/issues/114) ]]
of documents, and it's not even close to being well-baked. This also
adds additional endpoints to the AS, as this is separate from the
token request process, and therefore would require RS-facing
discovery or configuration information to make it work. Also-also,
it does presume the RS can sign requests in the same way that a
client does, but hopefully we can be more consistent with this than
RFC7662 was able to do. ]]
10.1. Introspecting a Token 10.1. Introspecting a Token
When the RS receives an access token, it can call the introspection When the RS receives an access token, it can call the introspection
endpoint at the AS to get token information. [[ Editor's note: this endpoint at the AS to get token information. [[ See issue #115
isn't super different from the token management URIs, but the RS has (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/115) ]]
no way to get that URI, and it's bound to the RS's keys instead of
the RC's or token's keys. ]]
+------+ +------+ +------+ +------+ +------+ +------+
| RC |--(1)->| RS | | AS | | RC |--(1)->| RS | | AS |
| | | |--(2)->| | | | | |--(2)->| |
| | | |<-(3)--| | | | | |<-(3)--| |
| | | | +------+ | | | | +------+
| |<-(4)--| | | |<-(4)--| |
+------+ +------+ +------+ +------+
1. The RC calls the RS with its access token. 1. The RC calls the RS with its access token.
2. The RS introspects the access token value at the AS. The RS 2. The RS introspects the access token value at the AS. The RS
signs the request with its own key (not the RC's key or the signs the request with its own key (not the RC's key or the
token's key). token's key).
3. The AS validates the token value and the RC's request and returns 3. The AS validates the token value and the RC's request and returns
the introspection response for the token. the introspection response for the token.
4. The RS fulfills the request from the RC. 4. The RS fulfills the request from the RC.
skipping to change at page 99, line 16 skipping to change at page 88, line 44
6. RS1 fulfills the call from RC. 6. RS1 fulfills the call from RC.
If the RS needs to derive a token from one presented to it, it can If the RS needs to derive a token from one presented to it, it can
request one from the AS by making a token request as described in request one from the AS by making a token request as described in
Section 2 and presenting the existing access token's value in the Section 2 and presenting the existing access token's value in the
"existing_access_token" field. "existing_access_token" field.
The RS MUST identify itself with its own key and sign the request. The RS MUST identify itself with its own key and sign the request.
[[ Editor's note: this is similar to Section 2.7 but based on the [[ See issue #116 (https://github.com/ietf-wg-gnap/gnap-core-
access token and not the grant. We might be able to re-use that protocol/issues/116) ]]
function: the fact that the keys presented are not the ones used for
the access token should indicate that it's a different party and a
different kind of request, but there might be some subtle security
issues there. ]]
POST /tx HTTP/1.1 POST /tx HTTP/1.1
Host: server.example.com Host: server.example.com
Content-type: application/json Content-type: application/json
Detached-JWS: ejy0... Detached-JWS: ejy0...
{ {
"resources": [ "resources": [
{ {
"actions": [ "actions": [
skipping to change at page 101, line 5 skipping to change at page 90, line 45
Content-type: application/json Content-type: application/json
{ {
"resource_handle": "FWWIKYBQ6U56NL1" "resource_handle": "FWWIKYBQ6U56NL1"
} }
The RS MAY make this handle available as part of a response The RS MAY make this handle available as part of a response
(Section 10.4) or as documentation to developers. (Section 10.4) or as documentation to developers.
[[ Editor's note: It's not an exact match here because the [[ See issue #117 (https://github.com/ietf-wg-gnap/gnap-core-
"resource_handle" returned now represents a collection of objects protocol/issues/117) ]]
instead of a single one. Perhaps we should let this return a list of
strings instead? Or use a different syntax than the resource
request? Also, this borrows heavily from UMA 2's "distributed
authorization" model and, like UMA, might be better suited to an
extension than the core protocol. ]]
10.4. Requesting a Resources With Insufficient Access 10.4. Requesting Resources With Insufficient Access
If the RC calls an RS without an access token, or with an invalid If the RC calls an RS without an access token, or with an invalid
access token, the RS MAY respond to the RC with an authentication access token, the RS MAY respond to the RC with an authentication
header indicating that GNAP needs to be used to access the resource. header indicating that GNAP needs to be used to access the resource.
The address of the GNAP endpoint MUST be sent in the "as_uri" The address of the GNAP endpoint MUST be sent in the "as_uri"
parameter. The RS MAY additionally return a resource reference that parameter. The RS MAY additionally return a resource reference that
the RC MAY use in its resource request (Section 2.1). This resource the RC MAY use in its resource request (Section 2.1). This resource
reference handle SHOULD be sufficient for at least the action the RC reference handle SHOULD be sufficient for at least the action the RC
was attempting to take at the RS. The RS MAY use the dynamic was attempting to take at the RS. The RS MAY use the dynamic
resource handle request (Section 10.3) to register a new resource resource handle request (Section 10.3) to register a new resource
skipping to change at page 101, line 35 skipping to change at page 91, line 27
what the AS is protecting. The content of this handle is opaque to what the AS is protecting. The content of this handle is opaque to
the RS and the RC. the RS and the RC.
WWW-Authenticate: GNAP as_uri=http://server.example/tx,resource=FWWIKYBQ6U56NL1 WWW-Authenticate: GNAP as_uri=http://server.example/tx,resource=FWWIKYBQ6U56NL1
The RC then makes a call to the "as_uri" as described in Section 2, The RC then makes a call to the "as_uri" as described in Section 2,
with the value of "resource" as one of the members of a "resources" with the value of "resource" as one of the members of a "resources"
array Section 2.1.1. The RC MAY request additional resources and array Section 2.1.1. The RC MAY request additional resources and
other information, and MAY request multiple access tokens. other information, and MAY request multiple access tokens.
[[ Editor's note: this borrows heavily from UMA 2's "distributed [[ See issue #118 (https://github.com/ietf-wg-gnap/gnap-core-
authorization" model and, like UMA, might be better suited to an protocol/issues/118) ]]
extension than the core protocol. ]]
11. Acknowledgements 11. Acknowledgements
The author would like to thank the feedback of the following The author would like to thank the feedback of the following
individuals for their reviews, implementations, and contributions: individuals for their reviews, implementations, and contributions:
Aaron Parecki, Annabelle Backman, Dick Hardt, Dmitri Zagidulin, Aaron Parecki, Annabelle Backman, Dick Hardt, Dmitri Zagidulin,
Dmitry Barinov, Fabien Imbault, Francis Pouatcha, George Fletcher, Dmitry Barinov, Fabien Imbault, Francis Pouatcha, George Fletcher,
Haardik Haardik, Hamid Massaoud, Jacky Yuan, Joseph Heenan, Kathleen Haardik Haardik, Hamid Massaoud, Jacky Yuan, Joseph Heenan, Kathleen
Moriarty, Mike Jones, Mike Varley, Nat Sakimura, Takahiko Kawasaki, Moriarty, Mike Jones, Mike Varley, Nat Sakimura, Takahiko Kawasaki,
Takahiro Tsuchiya. Takahiro Tsuchiya.
skipping to change at page 104, line 40 skipping to change at page 94, line 27
<https://www.rfc-editor.org/info/rfc8693>. <https://www.rfc-editor.org/info/rfc8693>.
[RFC8705] Campbell, B., Bradley, J., Sakimura, N., and T. [RFC8705] Campbell, B., Bradley, J., Sakimura, N., and T.
Lodderstedt, "OAuth 2.0 Mutual-TLS Client Authentication Lodderstedt, "OAuth 2.0 Mutual-TLS Client Authentication
and Certificate-Bound Access Tokens", RFC 8705, and Certificate-Bound Access Tokens", RFC 8705,
DOI 10.17487/RFC8705, February 2020, DOI 10.17487/RFC8705, February 2020,
<https://www.rfc-editor.org/info/rfc8705>. <https://www.rfc-editor.org/info/rfc8705>.
Appendix A. Document History Appendix A. Document History
* -02
- Moved all "editor's note" items to GitHub Issues.
* -01 * -01
- "updated_at" subject info timestamp now in ISO 8601 string - "updated_at" subject info timestamp now in ISO 8601 string
format. format.
- Editorial fixes. - Editorial fixes.
- Added Aaron and Fabien as document authors. - Added Aaron and Fabien as document authors.
* -00 * -00
skipping to change at page 116, line 28 skipping to change at page 106, line 28
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L", "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L",
"resources": [ "resources": [
"dolphin-metadata", "some other thing" "dolphin-metadata", "some other thing"
] ]
} }
} }
D.2. Applying OAuth 2 Scopes and Client IDs D.2. Applying OAuth 2 Scopes and Client IDs
While the GNAP protocol is not designed to be directly compatible While GNAP is not designed to be directly compatible with OAuth 2
with OAuth 2 [RFC6749], considerations have been made to enable the [RFC6749], considerations have been made to enable the use of OAuth 2
use of OAuth 2 concepts and constructs more smoothly within the GNAP concepts and constructs more smoothly within GNAP.
protocol.
In this scenario, the client developer has a "client_id" and set of In this scenario, the client developer has a "client_id" and set of
"scope" values from their OAuth 2 system and wants to apply them to "scope" values from their OAuth 2 system and wants to apply them to
the new protocol. Traditionally, the OAuth 2 client developer would the new protocol. Traditionally, the OAuth 2 client developer would
put their "client_id" and "scope" values as parameters into a put their "client_id" and "scope" values as parameters into a
redirect request to the authorization endpoint. redirect request to the authorization endpoint.
HTTP 302 Found HTTP 302 Found
Location: https://server.example.com/authorize Location: https://server.example.com/authorize
?client_id=7C7C4AZ9KHRS6X63AJAO ?client_id=7C7C4AZ9KHRS6X63AJAO
skipping to change at page 117, line 36 skipping to change at page 107, line 36
for authentication, the scopes represent resources that the client is for authentication, the scopes represent resources that the client is
requesting, and the "redirect_uri" and "state" value are pre-combined requesting, and the "redirect_uri" and "state" value are pre-combined
into a "callback" URI that can be unique per request. The client into a "callback" URI that can be unique per request. The client
additionally creates a nonce to protect the callback, separate from additionally creates a nonce to protect the callback, separate from
the state parameter that it has added to its return URL. the state parameter that it has added to its return URL.
From here, the protocol continues as above. From here, the protocol continues as above.
Appendix E. JSON Structures and Polymorphism Appendix E. JSON Structures and Polymorphism
The GNAP protocol makes use of polymorphism within the JSON [RFC8259] GNAP makes use of polymorphism within the JSON [RFC8259] structures
structures used for the protocol. Each portion of this protocol is used for the protocol. Each portion of this protocol is defined in
defined in terms of the JSON data type that its values can take, terms of the JSON data type that its values can take, whether it's a
whether it's a string, object, array, boolean, or number. For some string, object, array, boolean, or number. For some fields,
fields, different data types offer different descriptive capabilities different data types offer different descriptive capabilities and are
and are used in different situations for the same field. Each data used in different situations for the same field. Each data type
type provides a different syntax to express the same underlying provides a different syntax to express the same underlying semantic
semantic protocol element, which allows for optimization and protocol element, which allows for optimization and simplification in
simplification in many common cases. many common cases.
Even though JSON is often used to describe strongly typed structures, Even though JSON is often used to describe strongly typed structures,
JSON on its own is naturally polymorphic. In JSON, the named members JSON on its own is naturally polymorphic. In JSON, the named members
of an object have no type associated with them, and any data type can of an object have no type associated with them, and any data type can
be used as the value for any member. In practice, each member has a be used as the value for any member. In practice, each member has a
semantic type that needs to make sense to the parties creating and semantic type that needs to make sense to the parties creating and
consuming the object. Within this protocol, each object member is consuming the object. Within this protocol, each object member is
defined in terms of its semantic content, and this semantic content defined in terms of its semantic content, and this semantic content
might have expressions in different concrete data types for different might have expressions in different concrete data types for different
specific purposes. Since each object member has exactly one value in specific purposes. Since each object member has exactly one value in
 End of changes. 197 change blocks. 
1028 lines changed or deleted 625 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/