draft-ietf-gnap-core-protocol-02.txt   draft-ietf-gnap-core-protocol-03.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: 21 May 2021 Okta Expires: 10 July 2021 Okta
F. Imbault F. Imbault
acert.io acert.io
17 November 2020 6 January 2021
Grant Negotiation and Authorization Protocol Grant Negotiation and Authorization Protocol
draft-ietf-gnap-core-protocol-02 draft-ietf-gnap-core-protocol-03
Abstract Abstract
This document defines a mechanism for delegating authorization to a GNAP defines a mechanism for delegating authorization to a piece of
piece of software, and conveying that delegation to the software. software, and conveying that delegation to the software. This
This delegation can include access to a set of APIs as well as delegation can include access to a set of APIs as well as information
information passed directly to the software. passed directly to the software.
This document has been prepared by the GNAP working group design team
of Kathleen Moriarty, Fabien Imbault, Dick Hardt, Mike Jones, and
Justin Richer. This document is intended as a starting point for the
working group and includes decision points for discussion and
agreement. Many of the features in this proposed protocol can be
accomplished in a number of ways. Where possible, the editor has
included notes and discussion from the design team regarding the
options as understood.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
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 21 May 2021. This Internet-Draft will expire on 10 July 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2021 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 . . . . . . . . . . . . . . . . . . . . . . . 4
1.2. Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2. Roles . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3. Elements . . . . . . . . . . . . . . . . . . . . . . . . 6 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 . . . . . . . . . . . . . 15
1.4.4. Software-only Authorization . . . . . . . . . . . . . 15 1.4.4. Software-only Authorization . . . . . . . . . . . . . 16
1.4.5. Refreshing an Expired Access Token . . . . . . . . . 16 1.4.5. Refreshing an Expired Access Token . . . . . . . . . 17
2. Requesting Access . . . . . . . . . . . . . . . . . . . . . . 17 2. Requesting Access . . . . . . . . . . . . . . . . . . . . . . 18
2.1. Requesting Resources . . . . . . . . . . . . . . . . . . 19 2.1. Requesting Resources . . . . . . . . . . . . . . . . . . 20
2.1.1. Requesting a Single Access Token . . . . . . . . . . 19 2.1.1. Requesting a Single Access Token . . . . . . . . . . 20
2.1.2. Requesting Resources By Reference . . . . . . . . . . 21 2.1.2. Requesting Resources By Reference . . . . . . . . . . 24
2.1.3. Requesting Multiple Access Tokens . . . . . . . . . . 23 2.1.3. Requesting Multiple Access Tokens . . . . . . . . . . 26
2.1.4. Signaling Token Behavior . . . . . . . . . . . . . . 25 2.1.4. Signaling Token Behavior . . . . . . . . . . . . . . 28
2.2. Requesting User Information . . . . . . . . . . . . . . . 26 2.2. Requesting User Information . . . . . . . . . . . . . . . 29
2.3. Identifying the RC . . . . . . . . . . . . . . . . . . . 27 2.3. Identifying the Client Instance . . . . . . . . . . . . . 30
2.3.1. Identifying the RC Instance . . . . . . . . . . . . . 29 2.3.1. Identifying the Client Instance . . . . . . . . . . . 32
2.3.2. Identifying the RC Key . . . . . . . . . . . . . . . 30 2.3.2. Identifying the Client Instance Key . . . . . . . . . 33
2.3.3. Providing Displayable RC Information . . . . . . . . 31 2.3.3. Providing Displayable Client Instance Information . . 34
2.3.4. Authenticating the RC . . . . . . . . . . . . . . . . 31 2.3.4. Authenticating the Client Instance . . . . . . . . . 34
2.4. Identifying the User . . . . . . . . . . . . . . . . . . 32 2.4. Identifying the User . . . . . . . . . . . . . . . . . . 35
2.4.1. Identifying the User by Reference . . . . . . . . . . 33 2.4.1. Identifying the User by Reference . . . . . . . . . . 36
2.5. Interacting with the User . . . . . . . . . . . . . . . . 33 2.5. Interacting with the User . . . . . . . . . . . . . . . . 36
2.5.1. Redirect to an Arbitrary URL . . . . . . . . . . . . 35 2.5.1. Redirect to an Arbitrary URL . . . . . . . . . . . . 38
2.5.2. Open an Application-specific URL . . . . . . . . . . 36 2.5.2. Open an Application-specific URL . . . . . . . . . . 38
2.5.3. Receive a Callback After Interaction . . . . . . . . 36 2.5.3. Receive a Callback After Interaction . . . . . . . . 39
2.5.4. Display a Short User Code . . . . . . . . . . . . . . 38 2.5.4. Display a Short User Code . . . . . . . . . . . . . . 41
2.5.5. Indicate Desired Interaction Locales . . . . . . . . 38 2.5.5. Indicate Desired Interaction Locales . . . . . . . . 41
2.5.6. Extending Interaction Modes . . . . . . . . . . . . . 39 2.5.6. Extending Interaction Modes . . . . . . . . . . . . . 41
2.6. Declaring RC Capabilities . . . . . . . . . . . . . . . . 39 2.6. Declaring Client Capabilities . . . . . . . . . . . . . . 42
2.7. Referencing an Existing Grant Request . . . . . . . . . . 39 2.7. Referencing an Existing Grant Request . . . . . . . . . . 42
2.8. Requesting OpenID Connect Claims . . . . . . . . . . . . 39 2.8. Extending The Grant Request . . . . . . . . . . . . . . . 42
2.9. Extending The Grant Request . . . . . . . . . . . . . . . 40 3. Grant Response . . . . . . . . . . . . . . . . . . . . . . . 42
3. Grant Response . . . . . . . . . . . . . . . . . . . . . . . 40 3.1. Request Continuation . . . . . . . . . . . . . . . . . . 44
3.1. Request Continuation . . . . . . . . . . . . . . . . . . 42 3.2. Access Tokens . . . . . . . . . . . . . . . . . . . . . . 45
3.2. Access Tokens . . . . . . . . . . . . . . . . . . . . . . 43 3.2.1. Single Access Token . . . . . . . . . . . . . . . . . 45
3.2.1. Single Access Token . . . . . . . . . . . . . . . . . 43 3.2.2. Multiple Access Tokens . . . . . . . . . . . . . . . 48
3.2.2. Multiple Access Tokens . . . . . . . . . . . . . . . 46 3.3. Interaction Modes . . . . . . . . . . . . . . . . . . . . 49
3.3. Interaction Modes . . . . . . . . . . . . . . . . . . . . 47 3.3.1. Redirection to an arbitrary URL . . . . . . . . . . . 49
3.3.1. Redirection to an arbitrary URL . . . . . . . . . . . 47 3.3.2. Launch of an application URL . . . . . . . . . . . . 50
3.3.2. Launch of an application URL . . . . . . . . . . . . 48 3.3.3. Post-interaction Callback to a Client Instance
3.3.3. Post-interaction Callback to an RC URL . . . . . . . 48 Accessible URL . . . . . . . . . . . . . . . . . . . 50
3.3.4. Display of a Short User Code . . . . . . . . . . . . 49 3.3.4. Display of a Short User Code . . . . . . . . . . . . 51
3.3.5. Extending Interaction Mode Responses . . . . . . . . 50 3.3.5. Extending Interaction Mode Responses . . . . . . . . 52
3.4. Returning User Information . . . . . . . . . . . . . . . 50 3.4. Returning User Information . . . . . . . . . . . . . . . 52
3.5. Returning Dynamically-bound Reference Handles . . . . . . 51 3.5. Returning Dynamically-bound Reference Handles . . . . . . 53
3.6. Error Response . . . . . . . . . . . . . . . . . . . . . 53 3.6. Error Response . . . . . . . . . . . . . . . . . . . . . 55
3.7. Extending the Response . . . . . . . . . . . . . . . . . 53 3.7. Extending the Response . . . . . . . . . . . . . . . . . 55
4. Interaction at the AS . . . . . . . . . . . . . . . . . . . . 53 4. Interaction at the AS . . . . . . . . . . . . . . . . . . . . 55
4.1. Interaction at a Redirected URI . . . . . . . . . . . . . 54 4.1. Interaction at a Redirected URI . . . . . . . . . . . . . 56
4.2. Interaction at the User Code URI . . . . . . . . . . . . 54 4.2. Interaction at the User Code URI . . . . . . . . . . . . 56
4.3. Interaction through an Application URI . . . . . . . . . 55 4.3. Interaction through an Application URI . . . . . . . . . 57
4.4. Post-Interaction Completion . . . . . . . . . . . . . . . 55 4.4. Post-Interaction Completion . . . . . . . . . . . . . . . 57
4.4.1. Completing Interaction with a Browser Redirect to the 4.4.1. Completing Interaction with a Browser Redirect to the
Callback URI . . . . . . . . . . . . . . . . . . . . 56 Callback URI . . . . . . . . . . . . . . . . . . . . 57
4.4.2. Completing Interaction with a Direct HTTP Request 4.4.2. Completing Interaction with a Direct HTTP Request
Callback . . . . . . . . . . . . . . . . . . . . . . 56 Callback . . . . . . . . . . . . . . . . . . . . . . 58
4.4.3. Calculating the interaction hash . . . . . . . . . . 57 4.4.3. Calculating the interaction hash . . . . . . . . . . 59
5. Continuing a Grant Request . . . . . . . . . . . . . . . . . 58 5. Continuing a Grant Request . . . . . . . . . . . . . . . . . 60
5.1. Continuing After a Completed Interaction . . . . . . . . 60 5.1. Continuing After a Completed Interaction . . . . . . . . 62
5.2. Continuing During Pending Interaction . . . . . . . . . . 61 5.2. Continuing During Pending Interaction . . . . . . . . . . 63
5.3. Modifying an Existing Request . . . . . . . . . . . . . . 62 5.3. Modifying an Existing Request . . . . . . . . . . . . . . 64
5.4. Getting the Current State of a Grant Request . . . . . . 67 5.4. Getting the Current State of a Grant Request . . . . . . 69
5.5. Canceling a Grant Request . . . . . . . . . . . . . . . . 68 5.5. Canceling a Grant Request . . . . . . . . . . . . . . . . 70
6. Token Management . . . . . . . . . . . . . . . . . . . . . . 68 6. Token Management . . . . . . . . . . . . . . . . . . . . . . 70
6.1. Rotating the Access Token . . . . . . . . . . . . . . . . 69 6.1. Rotating the Access Token . . . . . . . . . . . . . . . . 71
6.2. Revoking the Access Token . . . . . . . . . . . . . . . . 70 6.2. Revoking the Access Token . . . . . . . . . . . . . . . . 72
7. Using Access Tokens . . . . . . . . . . . . . . . . . . . . . 71 7. Using Access Tokens . . . . . . . . . . . . . . . . . . . . . 73
8. Binding Keys . . . . . . . . . . . . . . . . . . . . . . . . 72 8. Binding Keys . . . . . . . . . . . . . . . . . . . . . . . . 74
8.1. Detached JWS . . . . . . . . . . . . . . . . . . . . . . 73 8.1. Detached JWS . . . . . . . . . . . . . . . . . . . . . . 75
8.2. Attached JWS . . . . . . . . . . . . . . . . . . . . . . 75 8.2. Attached JWS . . . . . . . . . . . . . . . . . . . . . . 77
8.3. Mutual TLS . . . . . . . . . . . . . . . . . . . . . . . 79 8.3. Mutual TLS . . . . . . . . . . . . . . . . . . . . . . . 81
8.4. Demonstration of Proof-of-Possession (DPoP) . . . . . . . 81 8.4. Demonstration of Proof-of-Possession (DPoP) . . . . . . . 83
8.5. HTTP Signing . . . . . . . . . . . . . . . . . . . . . . 82 8.5. HTTP Signing . . . . . . . . . . . . . . . . . . . . . . 84
8.6. OAuth Proof of Possession (PoP) . . . . . . . . . . . . . 83 8.6. OAuth Proof of Possession (PoP) . . . . . . . . . . . . . 85
9. Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . 85 9. Discovery . . . . . . . . . . . . . . . . . . . . . . . . . . 87
10. Resource Servers . . . . . . . . . . . . . . . . . . . . . . 86 10. Resource Servers . . . . . . . . . . . . . . . . . . . . . . 88
10.1. Introspecting a Token . . . . . . . . . . . . . . . . . 86 10.1. Introspecting a Token . . . . . . . . . . . . . . . . . 88
10.2. Deriving a downstream token . . . . . . . . . . . . . . 88 10.2. Deriving a downstream token . . . . . . . . . . . . . . 90
10.3. Registering a Resource Handle . . . . . . . . . . . . . 89 10.3. Registering a Resource Handle . . . . . . . . . . . . . 91
10.4. Requesting Resources With Insufficient Access . . . . . 91 10.4. Requesting Resources With Insufficient Access . . . . . 93
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 91 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 93
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 94
13. Security Considerations . . . . . . . . . . . . . . . . . . . 92 13. Security Considerations . . . . . . . . . . . . . . . . . . . 94
14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 92 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 94
15. Normative References . . . . . . . . . . . . . . . . . . . . 92 15. Normative References . . . . . . . . . . . . . . . . . . . . 94
Appendix A. Document History . . . . . . . . . . . . . . . . . . 94 Appendix A. Document History . . . . . . . . . . . . . . . . . . 96
Appendix B. Component Data Models . . . . . . . . . . . . . . . 94 Appendix B. Component Data Models . . . . . . . . . . . . . . . 97
Appendix C. Example Protocol Flows . . . . . . . . . . . . . . . 95 Appendix C. Example Protocol Flows . . . . . . . . . . . . . . . 97
C.1. Redirect-Based User Interaction . . . . . . . . . . . . . 95 C.1. Redirect-Based User Interaction . . . . . . . . . . . . . 97
C.2. Secondary Device Interaction . . . . . . . . . . . . . . 99 C.2. Secondary Device Interaction . . . . . . . . . . . . . . 101
Appendix D. No User Involvement . . . . . . . . . . . . . . . . 102 Appendix D. No User Involvement . . . . . . . . . . . . . . . . 104
D.1. Asynchronous Authorization . . . . . . . . . . . . . . . 103 D.1. Asynchronous Authorization . . . . . . . . . . . . . . . 105
D.2. Applying OAuth 2 Scopes and Client IDs . . . . . . . . . 106 D.2. Applying OAuth 2 Scopes and Client IDs . . . . . . . . . 108
Appendix E. JSON Structures and Polymorphism . . . . . . . . . . 107 Appendix E. JSON Structures and Polymorphism . . . . . . . . . . 109
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 108 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 110
1. Introduction 1. Introduction
This protocol allows a piece of software, the resource client, to This protocol allows a piece of software, the client instance, to
request delegated authorization to resource servers and to request request delegated authorization to resource servers and to request
direct information. This delegation is facilitated by an direct information. This delegation is facilitated by an
authorization server usually on behalf of a resource owner. The authorization server usually on behalf of a resource owner. The
requesting party operating the software may interact with the requesting party operating the software may interact with the
authorization server to authenticate, provide consent, and authorize authorization server to authenticate, provide consent, and authorize
the request. 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
GNAP allows for the negotiation of the grant process over time by GNAP allows for the negotiation of the grant process over time by
multiple parties acting in distinct roles. multiple parties acting in distinct roles.
skipping to change at page 5, line 20 skipping to change at page 5, line 12
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 GNAP perform actions under different roles. Roles are The parties in GNAP perform actions under different roles. Roles are
defined by the actions taken and the expectations leveraged on the defined by the actions taken and the expectations 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 an
the RC. The AS is defined by its grant endpoint, a single URL instance of the client. The AS is defined by its grant endpoint,
that accepts a POST request with a JSON payload. The AS could a single URL that accepts a POST request with a JSON payload. The
also have other endpoints, including interaction endpoints and AS could also have other endpoints, including interaction
user code endpoints, and these are introduced to the RC as needed endpoints and user code endpoints, and these are introduced to the
during the delegation process. RC as needed during the delegation process.
Resource Client (RC, aka "client") Requests tokens from the AS and Client Requests tokens and directly delegated information from the
uses tokens at the RS. An instance of the RC software is AS, and uses tokens at the RS. For some kinds of client software,
identified by its key, which can be known to the AS prior to the there could be many instances of a single piece of client
first request. The AS determines which policies apply to a given software. This specification differentiates between a specific
RC, including what it can request and on whose behalf. instance (the client instance) and the software running the
instance (the client software). A client instance is identified
by its unique key, which can be known to the AS prior to the first
request or introduced to the AS as part of the protocol. The AS
determines which policies apply to a given client instance,
including what it can request and on whose behalf.
Resource Server (RS, aka "API") Accepts tokens from the RC issued by Resource Server (RS, aka "API") Accepts tokens from the client
the AS and serves delegated resources on behalf of the RO. There instance issued by the AS and serves delegated resources on behalf
could be multiple RSs protected by the AS that the RC will call. of the RO. There could be multiple RSs protected by the AS that
the client instance will call.
Resource Owner (RO) Authorizes the request from the RC to the RS, Resource Owner (RO) Authorizes the request from the client instance
often interactively at the AS. to the RS, 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. client instance.
The design of GNAP does not assume any one deployment architecture, The design of GNAP does not assume any one deployment architecture,
but instead attempts to define roles that can be fulfilled in a but instead attempts to define roles that can be fulfilled in a
number of different ways for different use cases. As long as a given number of different ways for different use cases. As long as a given
role fulfills all of its obligations and behaviors as defined by the role fulfills all of its obligations and behaviors as defined by the
protocol, GNAP does not make additional requirements on its structure protocol, GNAP does not make additional requirements 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 client instance to act on their own behalf at
this case, one party fulfills both of the RO and RQ roles, but the the RS. In this case, one party fulfills both of the RO and RQ
roles themselves are still defined separately from each other to roles, but the roles themselves are still defined separately from
allow for other use cases where they are fulfilled by different each other to allow for other use cases where they are fulfilled by
parties. different parties.
For another example, in some complex scenarios, an RS receiving For another example, in some complex scenarios, an RS receiving
requests from one RC can act as an RC for a downstream secondary RS requests from one client instance can act as a client instance for a
in order to fulfill the original request. In this case, one piece of downstream secondary RS in order to fulfill the original request. In
software is both an RS and an RC from different perspectives, and it this case, one piece of software is both an RS and a client instance
fulfills these roles separately as far as the overall protocol is from different perspectives, and it fulfills these roles separately
concerned. as far as the overall protocol is concerned.
A single role need not be deployed as a monolithic service. For A single role need not be deployed as a monolithic service. For
example, An RC could have components that are installed on the RQ's example, A client instance could have components that are installed
device as well as a back-end system that it communicates with. If on the RQ's device as well as a back-end system that it communicates
both of these components participate in the delegation protocol, they with. If both of these components participate in the delegation
are both considered part of the RC. protocol, they are both considered part of the client instance. If
there are several copies of the client software that run separately
but all share the same key material, such as a deployed cluster, then
this cluster is considered a single client instance.
For another example, an AS could likewise be built out of many For another example, an AS could likewise be built out of many
constituent components in a distributed architecture. The component constituent components in a distributed architecture. The component
that the RC calls directly could be different from the component that that the client instance calls directly could be different from the
the the RO interacts with to drive consent, since API calls and user component that the the RO interacts with to drive consent, since API
interaction have different security considerations in many calls and user interaction have different security considerations in
environments. Furthermore, the AS could need to collect identity many environments. Furthermore, the AS could need to collect
claims about the RO from one system that deals with user attributes identity claims about the RO from one system that deals with user
while generating access tokens at another system that deals with attributes while generating access tokens at another system that
security rights. From the perspective of GNAP, all of these are deals with security rights. From the perspective of GNAP, all of
pieces of the AS and together fulfill the role of the AS as defined these are pieces of the AS and together fulfill the role of the AS as
by the protocol. defined by the protocol.
[[ See issue #29 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #29 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/29) ]] issues/29) ]]
[[ 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 client instance. The access token is created by
consumed and verified by the RS, and issued to and carried by the the AS, consumed and verified by the RS, and issued to and carried
RC. The contents and format of the access token are opaque to the by the client instance. The contents and format of the access
RC. token are opaque to the client.
Grant The process by which the RC requests and is given delegated Grant The process by which the client instance requests and is given
access to the RS by the AS through the authority of the RO. delegated access to the RS by the AS through the authority of the
RO.
Cryptographic Key A cryptographic element binding a request to a Cryptographic Key A cryptographic element binding a request to a
holder of the key. Access tokens and RC instances can be holder of the key. Access tokens and client instances can be
associated with specific keys. associated with specific keys.
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 client
Access to this resource is delegated by the RO as part of the instance. Access to this resource is delegated by the RO as part
grant process. of the 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 client instance from the AS without the client
call to an RS. Access to this information is delegated by the RO instance making a separate call to an RS. Access to this
as part of the grant process. information is delegated by the RO as part of the grant process.
[[ See issue #33 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/33) ]]
1.4. Sequences 1.4. Sequences
GNAP can be used in a variety of ways to allow the core delegation GNAP can be used in a variety of ways to allow the core 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 a
RC interested in only getting subject information directly, and not client instance interested in only getting subject information
calling an RS, all steps involving the RS below do not apply. directly, and not 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 preconfigured 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) |
+------------+ +------------+ +------------+ +------------+
+ + + +
+ + + +
(A) (B) (A) (B)
+ + + +
+ + + +
+--------+ + +------------+ +--------+ + +------------+
|Resource|--------------(1)------+------>| Resource | | Client |--------------(1)------+------>| Resource |
| Client | + | Server | |Instance| + | Server |
| (RC) | +---------------+ | (RS) | | | +---------------+ | (RS) |
| |--(2)->| Authorization | | | | |--(2)->| Authorization | | |
| |<-(3)--| Server | | | | |<-(3)--| Server | | |
| | | (AS) | | | | | | (AS) | | |
| |--(4)->| | | | | |--(4)->| | | |
| |<-(5)--| | | | | |<-(5)--| | | |
| |--------------(6)------------->| | | |--------------(6)------------->| |
| | | |<~(7)~~| | | | | |<~(7)~~| |
| |<-------------(8)------------->| | | |<-------------(8)------------->| |
| |--(9)->| | | | | |--(9)->| | | |
| |<-(10)-| | | | | |<-(10)-| | | |
skipping to change at page 8, line 39 skipping to change at page 8, line 39
| | | |<~(12)~| | | | | |<~(12)~| |
| |-(13)->| | | | | |-(13)->| | | |
| | | | | | | | | | | |
+--------+ +---------------+ +------------+ +--------+ +---------------+ +------------+
Legend Legend
+ + + indicates a possible interaction with a human + + + indicates a possible interaction with a human
----- indicates an interaction between protocol roles ----- indicates an interaction between protocol roles
~ ~ ~ indicates a potential equivalence or out-of-band communication between roles ~ ~ ~ indicates a potential equivalence or out-of-band communication between roles
* (A) The RQ interacts with the RC to indicate a need for resources * (A) The RQ interacts with the client instance to indicate a need
on behalf of the RO. This could identify the RS the RC needs to for resources on behalf of the RO. This could identify the RS the
call, the resources needed, or the RO that is needed to approve client instance needs to call, the resources needed, or the RO
the request. Note that the RO and RQ are often the same entity in that is needed to approve the request. Note that the RO and RQ
practice. are often the same entity in practice.
* (1) The RC attempts to call the RS (Section 10.4) to determine * (1) The client instance attempts to call the RS (Section 10.4) to
what access is needed. The RS informs the RC that access can be determine what access is needed. The RS informs the client
granted through the AS. Note that for most situations, the RC instance that access can be granted through the AS. Note that for
already knows which AS to talk to and which kinds of access it most situations, the client instance already knows which AS to
needs. talk to and which kinds of access it needs.
* (2) The RC requests access at the AS (Section 2). * (2) The client instance requests access at the AS (Section 2).
* (3) The AS processes the request and determines what is needed to * (3) The AS processes the request and determines what is needed to
fulfill the request. The AS sends its response to the RC fulfill the request. The AS sends its response to the client
(Section 3). instance (Section 3).
* (B) If interaction is required, the AS interacts with the RO * (B) If interaction is required, the AS interacts with the RO
(Section 4) to gather authorization. The interactive component of (Section 4) to gather authorization. The interactive component of
the AS can function using a variety of possible mechanisms the AS can function using a variety of possible mechanisms
including web page redirects, applications, challenge/response including web page redirects, applications, challenge/response
protocols, or other methods. The RO approves the request for the protocols, or other methods. The RO approves the request for the
RC being operated by the RQ. Note that the RO and RQ are often client instance being operated by the RQ. Note that the RO and RQ
the same entity in practice. are often the same entity in practice.
* (4) The RC continues the grant at the AS (Section 5). * (4) The client instance continues the grant at the AS (Section 5).
* (5) If the AS determines that access can be granted, it returns a * (5) If the AS determines that access can be granted, it returns a
response to the RC (Section 3) including an access token response to the client instance (Section 3) including an access
(Section 3.2) for calling the RS and any directly returned token (Section 3.2) for calling the RS and any directly returned
information (Section 3.4) about the RO. information (Section 3.4) about the RO.
* (6) The RC uses the access token (Section 7) to call the RS. * (6) The client instance uses the access token (Section 7) to call
the RS.
* (7) The RS determines if the token is sufficient for the request * (7) The RS determines if the token is sufficient for the request
by examining the token, potentially calling the AS (Section 10.1). by examining the token, potentially calling the AS (Section 10.1).
Note that the RS could also examine the token directly, call an Note that the RS could also examine the token directly, call an
internal data store, execute a policy engine request, or any internal data store, execute a policy engine request, or any
number of alternative methods for validating the token and its number of alternative methods for validating the token and its
fitness for the request. fitness for the request.
* (8) The RC to call the RS (Section 7) using the access token until * (8) The client instance calls the RS (Section 7) using the access
the RS or RC determine that the token is no longer valid. token until the RS or client instance determine that the token is
no longer valid.
* (9) When the token no longer works, the RC fetches an updated * (9) When the token no longer works, the client instance fetches an
access token (Section 6.1) based on the rights granted in (5). updated access token (Section 6.1) based on the rights granted in
(5).
* (10) The AS issues a new access token (Section 3.2) to the RC. * (10) The AS issues a new access token (Section 3.2) to the client
instance.
* (11) The RC uses the new access token (Section 7) to call the RS. * (11) The client instance 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 client instance disposes of the token (Section 6.2) once
completed its access of the RS and no longer needs the token. the client instance has 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 GNAP 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 client instance is a web application that
to resources on behalf of the current user, who acts as both the wants access to resources on behalf of the current user, who acts as
requesting party (RQ) and the resource owner (RO). Since the RC is both the requesting party (RQ) and the resource owner (RO). Since
capable of directing the user to an arbitrary URL and receiving the client instance is capable of directing the user to an arbitrary
responses from the user's browser, interaction here is handled URL and receiving responses from the user's browser, interaction here
through front-channel redirects using the user's browser. The RC is handled through front-channel redirects using the user's browser.
uses a persistent session with the user to ensure the same user that The client instance uses a persistent session with the user to ensure
is starting the interaction is the user that returns from the the same user that is starting the interaction is the user that
interaction. returns from the interaction.
+--------+ +--------+ +------+ +--------+ +--------+ +------+
| RC | | AS | | RO | | Client | | AS | | RO |
| | | | | + | |Instance| | | | + |
| |< (1) + Start Session + + + + + + + + + + + + + + + +| RQ | | |< (1) + Start Session + + + + + + + + + + + + + + + +| RQ |
| | | | |(User)| | | | | |(User)|
| |--(2)--- Request Access --------->| | | | | |--(2)--- Request Access --------->| | | |
| | | | | | | | | | | |
| |<-(3)-- Interaction Needed -------| | | | | |<-(3)-- Interaction Needed -------| | | |
| | | | | | | | | | | |
| |+ (4) + Redirect for Interaction + + + + + + + + + > | | | |+ (4) + Redirect for Interaction + + + + + + + + + > | |
| | | | | | | | | | | |
| | | |<+ (5) +>| | | | | |<+ (5) +>| |
| | | | AuthN | | | | | | AuthN | |
skipping to change at page 10, line 42 skipping to change at page 10, line 49
| | | | AuthZ | | | | | | AuthZ | |
| | | | | | | | | | | |
| |< (7) + Redirect for Continuation + + + + + + + + + +| | | |< (7) + Redirect for Continuation + + + + + + + + + +| |
| | | | +------+ | | | | +------+
| |--(8)--- Continue Request ------->| | | |--(8)--- Continue Request ------->| |
| | | | | | | |
| |<-(9)----- Grant Access ----------| | | |<-(9)----- Grant Access ----------| |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
1. The RC establishes a verifiable session to the user, in the role 1. The client instance establishes a verifiable session to the user,
of the RQ. in the role of the RQ.
2. The RC requests access to the resource (Section 2). The RC 2. The client instance requests access to the resource (Section 2).
indicates that it can redirect to an arbitrary URL The client instance indicates that it can redirect to an
(Section 2.5.1) and receive a callback from the browser arbitrary URL (Section 2.5.1) and receive a callback from the
(Section 2.5.3). The RC stores verification information for its browser (Section 2.5.3). The client instance stores verification
callback in the session created in (1). information for its callback in the session created in (1).
3. The AS determines that interaction is needed and responds 3. The AS determines that interaction is needed and responds
(Section 3) with a URL to send the user to (Section 3.3.1) and (Section 3) with a URL to send the user to (Section 3.3.1) and
information needed to verify the callback (Section 3.3.3) in (7). information needed to verify the callback (Section 3.3.3) in (7).
The AS also includes information the RC will need to continue the The AS also includes information the client instance will need to
request (Section 3.1) in (8). The AS associates this continue the request (Section 3.1) in (8). The AS associates
continuation information with an ongoing request that will be this continuation information with an ongoing request that will
referenced in (4), (6), and (8). be referenced in (4), (6), and (8).
4. The RC stores the verification and continuation information from 4. The client instance stores the verification and continuation
(3) in the session from (1). The RC then redirects the user to information from (3) in the session from (1). The client
the URL (Section 4.1) given by the AS in (3). The user's browser instance then redirects the user to the URL (Section 4.1) given
loads the interaction redirect URL. The AS loads the pending by the AS in (3). The user's browser loads the interaction
request based on the incoming URL generated in (3). redirect URL. The AS loads the pending request based on the
incoming URL generated in (3).
5. The user authenticates at the AS, taking on the role of the RO. 5. The user authenticates at the AS, taking on the role of the RO.
6. As the RO, the user authorizes the pending request from the RC. 6. As the RO, the user authorizes the pending request from the
client instance.
7. When the AS is done interacting with the user, the AS redirects 7. When the AS is done interacting with the user, the AS redirects
the user back (Section 4.4.1) to the RC using the callback URL the user back (Section 4.4.1) to the client instance using the
provided in (2). The callback URL is augmented with an callback URL provided in (2). The callback URL is augmented with
interaction reference that the AS associates with the ongoing an interaction reference that the AS associates with the ongoing
request created in (2) and referenced in (4). The callback URL request created in (2) and referenced in (4). The callback URL
is also augmented with a hash of the security information is also augmented with a hash of the security information
provided in (2) and (3). The RC loads the verification provided in (2) and (3). The client instance loads the
information from (2) and (3) from the session created in (1). verification information from (2) and (3) from the session
The RC calculates a hash (Section 4.4.3) based on this created in (1). The client instance calculates a hash
information and continues only if the hash validates. Note that (Section 4.4.3) based on this information and continues only if
the RC needs to ensure that the parameters for the incoming the hash validates. Note that the client instance needs to
request match those that it is expecting from the session created ensure that the parameters for the incoming request match those
in (1). The RC also needs to be prepared for the RQ never being that it is expecting from the session created in (1). The client
returned to the RC and handle time outs appropriately. instance also needs to be prepared for the RQ never being
returned to the client instance and handle time outs
appropriately.
8. The RC loads the continuation information from (3) and sends the 8. The client instance loads the continuation information from (3)
interaction reference from (7) in a request to continue the and sends the interaction reference from (7) in a request to
request (Section 5.1). The AS validates the interaction continue the request (Section 5.1). The AS validates the
reference ensuring that the reference is associated with the interaction reference ensuring that the reference is associated
request being continued. with the request being continued.
9. If the request has been authorized, the AS grants access to the 9. If the request has been authorized, the AS grants access to the
information in the form of access tokens (Section 3.2) and direct information in the form of access tokens (Section 3.2) and direct
subject information (Section 3.4) to the RC. subject information (Section 3.4) to the client instance.
An example set of protocol messages for this method can be found in An example set of protocol messages for this method can be found in
Appendix C.1. Appendix C.1.
1.4.2. User-code Interaction 1.4.2. User-code Interaction
In this example flow, the RC is a device that is capable of In this example flow, the client instance is a device that is capable
presenting a short, human-readable code to the user and directing the of presenting a short, human-readable code to the user and directing
user to enter that code at a known URL. The RC is not capable of the user to enter that code at a known URL. The client instance is
presenting an arbitrary URL to the user, nor is it capable of not capable of presenting an arbitrary URL to the user, nor is it
accepting incoming HTTP requests from the user's browser. The RC capable of accepting incoming HTTP requests from the user's browser.
polls the AS while it is waiting for the RO to authorize the request. The client instance polls the AS while it is waiting for the RO to
The user's interaction is assumed to occur on a secondary device. In authorize the request. The user's interaction is assumed to occur on
this example it is assumed that the user is both the RQ and RO, a secondary device. In this example it is assumed that the user is
though the user is not assumed to be interacting with the RC through both the RQ and RO, though the user is not assumed to be interacting
the same web browser used for interaction at the AS. with the client instance through the same web browser used for
interaction at the AS.
+--------+ +--------+ +------+ +--------+ +--------+ +------+
| RC | | AS | | RO | | Client | | AS | | RO |
| |--(1)--- Request Access --------->| | | + | |Instance|--(1)--- Request Access --------->| | | + |
| | | | | RQ | | | | | | RQ |
| |<-(2)-- Interaction Needed -------| | |(User)| | |<-(2)-- Interaction Needed -------| | |(User)|
| | | | | | | | | | | |
| |+ (3) + + Display User Code + + + + + + + + + + + + >| | | |+ (3) + + Display User Code + + + + + + + + + + + + >| |
| | | | | | | | | | | |
| | | |<+ (4) + | | | | | |<+ (4) + | |
| | | |Open URI | | | | | |Open URI | |
| | | | | | | | | | | |
| | | |<+ (5) +>| | | | | |<+ (5) +>| |
| | | | AuthN | | | | | | AuthN | |
skipping to change at page 12, line 47 skipping to change at page 13, line 34
| | | | | | | | | | | |
| | | |<+ (8) +>| | | | | |<+ (8) +>| |
| | | |Completed| | | | | |Completed| |
| | | | | | | | | | | |
| |--(11)-- Continue Request (B) --->| | +------+ | |--(11)-- Continue Request (B) --->| | +------+
| | | | | | | |
| |<-(12)----- Grant Access ---------| | | |<-(12)----- Grant Access ---------| |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
1. The RC requests access to the resource (Section 2). The RC 1. The client instance requests access to the resource (Section 2).
indicates that it can display a user code (Section 2.5.4). The client instance indicates that it can display a user code
(Section 2.5.4).
2. The AS determines that interaction is needed and responds 2. The AS determines that interaction is needed and responds
(Section 3) with a user code to communicate to the user (Section 3) with a user code to communicate to the user
(Section 3.3.4). This could optionally include a URL to direct (Section 3.3.4). This could optionally include a URL to direct
the user to, but this URL should be static and so could be the user to, but this URL should be static and so could be
configured in the RC's documentation. The AS also includes configured in the client instance's documentation. The AS also
information the RC will need to continue the request includes information the client instance will need to continue
(Section 3.1) in (8) and (10). The AS associates this the request (Section 3.1) in (8) and (10). The AS associates
continuation information with an ongoing request that will be this continuation information with an ongoing request that will
referenced in (4), (6), (8), and (10). be referenced in (4), (6), (8), and (10).
3. The RC stores the continuation information from (2) for use in 3. The client instance stores the continuation information from (2)
(8) and (10). The RC then communicates the code to the user for use in (8) and (10). The client instance then communicates
(Section 4.1) given by the AS in (2). the code to the user (Section 4.1) given by the AS in (2).
4. The user's directs their browser to the user code URL. This URL 4. The user's directs their browser to the user code URL. This URL
is stable and can be communicated via the RC's documentation, is stable and can be communicated via the client software's
the AS documentation, or the RC software itself. Since it is documentation, the AS documentation, or the client software
assumed that the RO will interact with the AS through a itself. Since it is assumed that the RO will interact with the
secondary device, the RC does not provide a mechanism to launch AS through a secondary device, the client instance does not
the RO's browser at this URL. provide a mechanism to launch the RO's browser at this URL.
5. The RQ authenticates at the AS, taking on the role of the RO. 5. The RQ authenticates at the AS, taking on the role of the RO.
6. The RO enters the code communicated in (3) to the AS. The AS 6. The RO enters the code communicated in (3) to the AS. The AS
validates this code against a current request in process. validates this code against a current request in process.
7. As the RO, the user authorizes the pending request from the RC. 7. As the RO, the user authorizes the pending request from the
client instance.
8. When the AS is done interacting with the user, the AS indicates 8. When the AS is done interacting with the user, the AS indicates
to the RO that the request has been completed. to the RO that the request has been completed.
9. Meanwhile, the RC loads the continuation information stored at 9. Meanwhile, the client instance loads the continuation
(3) and continues the request (Section 5). The AS determines information stored at (3) and continues the request (Section 5).
which ongoing access request is referenced here and checks its The AS determines which ongoing access request is referenced
state. here and checks its state.
10. If the access request has not yet been authorized by the RO in 10. If the access request has not yet been authorized by the RO in
(6), the AS responds to the RC to continue the request (6), the AS responds to the client instance to continue the
(Section 3.1) at a future time through additional polled request (Section 3.1) at a future time through additional polled
continuation requests. This response can include updated continuation requests. This response can include updated
continuation information as well as information regarding how continuation information as well as information regarding how
long the RC should wait before calling again. The RC replaces long the client instance should wait before calling again. The
its stored continuation information from the previous response client instance replaces its stored continuation information
(2). Note that the AS may need to determine that the RO has not from the previous response (2). Note that the AS may need to
approved the request in a sufficient amount of time and return determine that the RO has not approved the request in a
an appropriate error to the RC. sufficient amount of time and return an appropriate error to the
client instance.
11. The RC continues to poll the AS (Section 5.2) with the new 11. The client instance continues to poll the AS (Section 5.2) with
continuation information in (9). the new continuation information in (9).
12. If the request has been authorized, the AS grants access to the 12. If the request has been authorized, the AS grants access to the
information in the form of access tokens (Section 3.2) and information in the form of access tokens (Section 3.2) and
direct subject information (Section 3.4) to the RC. direct subject information (Section 3.4) to the client instance.
An example set of protocol messages for this method can be found in An example set of protocol messages for this method can be found in
Appendix C.2. Appendix C.2.
1.4.3. Asynchronous Authorization 1.4.3. Asynchronous Authorization
In this example flow, the RQ and RO roles are fulfilled by different In this example flow, the RQ and RO roles are fulfilled by different
parties, and the RO does not interact with the RC. The AS reaches parties, and the RO does not interact with the client instance. The
out asynchronously to the RO during the request process to gather the AS reaches out asynchronously to the RO during the request process to
RO's authorization for the RC's request. The RC polls the AS while gather the RO's authorization for the client instance's request. The
it is waiting for the RO to authorize the request. client instance polls the AS while it is waiting for the RO to
authorize the request.
+--------+ +--------+ +------+ +--------+ +--------+ +------+
| RC | | AS | | RO | | Client | | AS | | RO |
| |--(1)--- Request Access --------->| | | | |Instance|--(1)--- Request Access --------->| | | |
| | | | | | | | | | | |
| |<-(2)-- Not Yet Granted (Wait) ---| | | | | |<-(2)-- Not Yet Granted (Wait) ---| | | |
| | | |<+ (3) +>| | | | | |<+ (3) +>| |
| | | | AuthN | | | | | | AuthN | |
| |--(6)--- Continue Request (A) --->| | | | | |--(6)--- Continue Request (A) --->| | | |
| | | |<+ (4) +>| | | | | |<+ (4) +>| |
| |<-(7)-- Not Yet Granted (Wait) ---| | AuthZ | | | |<-(7)-- Not Yet Granted (Wait) ---| | AuthZ | |
| | | | | | | | | | | |
| | | |<+ (5) +>| | | | | |<+ (5) +>| |
| | | |Completed| | | | | |Completed| |
| | | | | | | | | | | |
| |--(8)--- Continue Request (B) --->| | +------+ | |--(8)--- Continue Request (B) --->| | +------+
| | | | | | | |
| |<-(9)------ Grant Access ---------| | | |<-(9)------ Grant Access ---------| |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
1. The RC requests access to the resource (Section 2). The RC does 1. The client instance requests access to the resource (Section 2).
not send any interactions modes to the server, indicating that it The client instance does not send any interactions modes to the
does not expect to interact with the RO. The RC can also signal server, indicating that it does not expect to interact with the
which RO it requires authorization from, if known, by using the RO. The client instance can also signal which RO it requires
user request section (Section 2.4). authorization from, if known, by using the user request section
(Section 2.4).
2. The AS determines that interaction is needed, but the RC cannot 2. The AS determines that interaction is needed, but the client
interact with the RO. The AS responds (Section 3) with the instance cannot interact with the RO. The AS responds
information the RC will need to continue the request (Section 3) with the information the client instance will need to
(Section 3.1) in (6) and (8), including a signal that the RC continue the request (Section 3.1) in (6) and (8), including a
should wait before checking the status of the request again. The signal that the client instance should wait before checking the
AS associates this continuation information with an ongoing status of the request again. The AS associates this continuation
request that will be referenced in (3), (4), (5), (6), and (8). information with an ongoing request that will be referenced in
(3), (4), (5), (6), and (8).
3. The AS determines which RO to contact based on the request in 3. The AS determines which RO to contact based on the request in
(1), through a combination of the user request (Section 2.4), the (1), through a combination of the user request (Section 2.4), the
resources request (Section 2.1), and other policy information. resources request (Section 2.1), and other policy information.
The AS contacts the RO and authenticates them. The AS contacts the RO and authenticates them.
4. The RO authorizes the pending request from the RC. 4. The RO authorizes the pending request from the client instance.
5. When the AS is done interacting with the RO, the AS indicates to 5. When the AS is done interacting with the RO, the AS indicates to
the RO that the request has been completed. the RO that the request has been completed.
6. Meanwhile, the RC loads the continuation information stored at 6. Meanwhile, the client instance loads the continuation information
(3) and continues the request (Section 5). The AS determines stored at (3) and continues the request (Section 5). The AS
which ongoing access request is referenced here and checks its determines which ongoing access request is referenced here and
state. checks its state.
7. If the access request has not yet been authorized by the RO in 7. If the access request has not yet been authorized by the RO in
(6), the AS responds to the RC to continue the request (6), the AS responds to the client instance to continue the
(Section 3.1) at a future time through additional polling. This request (Section 3.1) at a future time through additional
response can include refreshed credentials as well as information polling. This response can include refreshed credentials as well
regarding how long the RC should wait before calling again. The as information regarding how long the client instance should wait
RC replaces its stored continuation information from the previous before calling again. The client instance replaces its stored
response (2). Note that the AS may need to determine that the RO continuation information from the previous response (2). Note
has not approved the request in a sufficient amount of time and that the AS may need to determine that the RO has not approved
return an appropriate error to the RC. the request in a sufficient amount of time and return an
appropriate error to the client instance.
8. The RC continues to poll the AS (Section 5.2) with the new 8. The client instance continues to poll the AS (Section 5.2) with
continuation information from (7). the new continuation information from (7).
9. If the request has been authorized, the AS grants access to the 9. If the request has been authorized, the AS grants access to the
information in the form of access tokens (Section 3.2) and direct information in the form of access tokens (Section 3.2) and direct
subject information (Section 3.4) to the RC. subject information (Section 3.4) to the client instance.
An example set of protocol messages for this method can be found in An example set of protocol messages for this method can be found in
Appendix D.1. Appendix D.1.
1.4.4. Software-only Authorization 1.4.4. Software-only Authorization
In this example flow, the AS policy allows the RC to make a call on In this example flow, the AS policy allows the client instance to
its own behalf, without the need for a RO to be involved at runtime make a call on its own behalf, without the need for a RO to be
to approve the decision. Since there is no explicit RO, the RC does involved at runtime to approve the decision. Since there is no
not interact with an RO. explicit RO, the client instance does not interact with an RO.
+--------+ +--------+ +--------+ +--------+
| RC | | AS | | Client | | AS |
| |--(1)--- Request Access --------->| | |Instance|--(1)--- Request Access --------->| |
| | | | | | | |
| |<-(2)---- Grant Access -----------| | | |<-(2)---- Grant Access -----------| |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
1. The RC requests access to the resource (Section 2). The RC does 1. The client instance requests access to the resource (Section 2).
not send any interactions modes to the server. The client instance does not send any interactions modes to the
server.
2. The AS determines that the request is been authorized, the AS 2. The AS determines that the request is been authorized, the AS
grants access to the information in the form of access tokens grants access to the information in the form of access tokens
(Section 3.2) and direct subject information (Section 3.4) to the (Section 3.2) and direct subject information (Section 3.4) to the
RC. client instance.
An example set of protocol messages for this method can be found in An example set of protocol messages for this method can be found in
Appendix D. Appendix D.
1.4.5. Refreshing an Expired Access Token 1.4.5. Refreshing an Expired Access Token
In this example flow, the RC receives an access token to access a In this example flow, the client instance receives an access token to
resource server through some valid GNAP process. The RC uses that access a resource server through some valid GNAP process. The client
token at the RS for some time, but eventually the access token instance uses that token at the RS for some time, but eventually the
expires. The RC then gets a new access token by rotating the expired access token expires. The client instance then gets a new access
access token at the AS using the token's management URL. token by rotating the expired access token at the AS using the
token's management URL.
+--------+ +--------+ +--------+ +--------+
| RC | | AS | | Client | | AS |
| |--(1)--- Request Access ----------------->| | |Instance|--(1)--- Request Access ----------------->| |
| | | | | | | |
| |<-(2)--- Grant Access --------------------| | | |<-(2)--- Grant Access --------------------| |
| | | | | | | |
| | +--------+ | | | | +--------+ | |
| |--(3)--- Access Resource --->| RS | | | | |--(3)--- Access Resource --->| RS | | |
| | | | | | | | | | | |
| |<-(4)--- Error Response -----| | | | | |<-(4)--- Error Response -----| | | |
| | +--------+ | | | | +--------+ | |
| | | | | | | |
| |--(5)--- Rotate Token ------------------->| | | |--(5)--- Rotate Token ------------------->| |
| | | | | | | |
| |<-(6)--- Rotated Token -------------------| | | |<-(6)--- Rotated Token -------------------| |
| | | | | | | |
+--------+ +--------+ +--------+ +--------+
1. The RC requests access to the resource (Section 2). 1. The client instance requests access to the resource (Section 2).
2. The AS grants access to the resource (Section 3) with an access 2. The AS grants access to the resource (Section 3) with an access
token (Section 3.2) usable at the RS. The access token response token (Section 3.2) usable at the RS. The access token response
includes a token management URI. includes a token management URI.
3. The RC presents the token (Section 7) to the RS. The RS 3. The client instance presents the token (Section 7) to the RS.
validates the token and returns an appropriate response for the The RS validates the token and returns an appropriate response
API. for the API.
4. When the access token is expired, the RS responds to the RC with 4. When the access token is expired, the RS responds to the client
an error. instance with an error.
5. The RC calls the token management URI returned in (2) to rotate 5. The client instance calls the token management URI returned in
the access token (Section 6.1). The RC presents the access token (2) to rotate the access token (Section 6.1). The client
as well as the appropriate key. instance presents the access token as well as the appropriate
key.
6. The AS validates the rotation request including the signature and 6. The AS validates the rotation request including the signature and
keys presented in (5) and returns a new access token keys presented in (5) and returns a new access token
(Section 3.2.1). The response includes a new access token and (Section 3.2.1). The response includes a new access token and
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). client instance 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 client instance sends JSON [RFC8259] document
object as its root. Each member of the request object represents a with an object as its root. Each member of the request object
different aspect of the RC's request. Each field is described in represents a different aspect of the client instance's request. Each
detail in a section below. field is described in detail in a section below.
resources (object / array of objects/strings) Describes the rights resources (object / array of objects/strings) Describes the rights
that the RC is requesting for one or more access tokens to be used that the client instance is requesting for one or more access
at RS's. Section 2.1 tokens to be used at RS's. Section 2.1
subject (object) Describes the information about the RO that the RC subject (object) Describes the information about the RO that the
is requesting to be returned directly in the response from the AS. client instance is requesting to be returned directly in the
Section 2.2 response from the AS. Section 2.2
client (object / string) Describes the RC that is making this client (object / string) Describes the client instance that is
request, including the key that the RC will use to protect this making this request, including the key that the client instance
request and any continuation requests at the AS and any user- will use to protect this request and any continuation requests at
facing information about the RC used in interactions at the AS. the AS and any user-facing information about the client instance
Section 2.3 used in interactions at the AS. Section 2.3
user (object / string) Identifies the RQ to the AS in a manner that user (object / string) Identifies the RQ to the AS in a manner that
the AS can verify, either directly or by interacting with the RQ the AS can verify, either directly or by interacting with the RQ
to determine their status as the RO. Section 2.4 to determine their status as the RO. Section 2.4
interact (object) Describes the modes that the RC has for allowing interact (object) Describes the modes that the client instance has
the RO to interact with the AS and modes for the RC to receive for allowing the RO to interact with the AS and modes for the
updates when interaction is complete. Section 2.5 client instance to receive updates when interaction is complete.
Section 2.5
capabilities (array of strings) Identifies named extension capabilities (array of strings) Identifies named extension
capabilities that the RC can use, signaling to the AS which capabilities that the client instance can use, signaling to the AS
extensions it can use. Section 2.6 which extensions it can use. Section 2.6
existing_grant (string) Identifies a previously-existing grant that existing_grant (string) Identifies a previously-existing grant that
the RC is extending with this request. Section 2.7 the client instance is extending with this request. Section 2.7
claims (object) Identifies the identity claims to be returned as
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.8
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",
"actions": [ "actions": [
"read", "read",
"write", "write",
skipping to change at page 19, line 31 skipping to change at page 20, line 30
"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
If the RC is requesting one or more access tokens for the purpose of If the client instance is requesting one or more access tokens for
accessing an API, the RC MUST include a "resources" field. This the purpose of accessing an API, the client instance MUST include a
field MUST be an array (for a single access token (Section 2.1.1)) or "resources" field. This field MUST be an array (for a single access
an object (for multiple access tokens (Section 2.1.3)), as described token (Section 2.1.1)) or an object (for multiple access tokens
in the following sections. (Section 2.1.3)), as described in the following sections.
2.1.1. Requesting a Single Access Token 2.1.1. Requesting a Single Access Token
When requesting an access token, the RC MUST send a "resources" field When requesting an access token, the client instance MUST send a
containing a JSON array. The elements of the JSON array represent "resources" field containing a JSON array. The elements of the JSON
rights of access that the RC is requesting in the access token. The array represent rights of access that the client instance is
requested access is the sum of all elements within the array. requesting in the access token. The requested access is the union of
all elements within the array.
The RC declares what access it wants to associated with the resulting The client instance declares what access it wants to associate with
access token using objects that describe multiple dimensions of the resulting access token using objects that describe multiple
access. Each object contains a "type" property that determines the dimensions of access. Each object contains a "type" property that
type of API that the RC is calling. determines the type of API that the client instance is calling.
type (string) The type of resource request as a string. This field type (string) The type of resource request as a string. This field
MAY define which other fields are allowed in the request object. MAY define which other fields are allowed in the request object.
This 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.
[[ See issue #34 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ actions (array of strings) The types of actions the client instance
issues/34) ]] will take at the RS as an array of strings. For example, a client
instance asking for a combination of "read" and "write" access.
actions (array of strings) The types of actions the RC will take at
the RS as an array of strings. For example, an RC asking for a
combination of "read" and "write" access.
locations (array of strings) The location of the RS as an array of locations (array of strings) The location of the RS as an array of
strings. These strings are typically URIs identifying the strings. These strings are typically URIs identifying the
location of the RS. location of the RS.
datatypes (array of strings) The kinds of data available to the RC datatypes (array of strings) The kinds of data available to the
at the RS's API as an array of strings. For example, an RC asking client instance at the RS's API as an array of strings. For
for access to raw "image" data and "metadata" at a photograph API. example, a client instance asking for access to raw "image" data
and "metadata" at a photograph API.
identifier (string) A string identifier indicating a specific identifier (string) A string identifier indicating a specific
resource at the RS. For example, a patient identifier for a resource at the RS. For example, a patient identifier for a
medical API or a bank 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 is asking for three kinds of
API-specific fields as part of two different access "type" values. access (read, write, delete) to each of two different locations and
two different data types (metadata, images) for a single access token
using the fictitious "photo-api" type definition.
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
"read", "read",
"write", "write",
"dolphin" "delete"
], ],
"locations": [ "locations": [
"https://server.example.net/", "https://server.example.net/",
"https://resource.local/other" "https://resource.local/other"
], ],
"datatypes": [ "datatypes": [
"metadata", "metadata",
"images" "images"
] ]
}
]
The access requested for a given object when using these fields is
the cross-product of all fields of the object. That is to say, the
object represents a request for all "action" values listed within the
object to be used at all "locations" values listed within the object
for all "datatype" values listed within the object. Assuming the
request above was granted, the RC could assume that it would be able
to do a "read" action against the "images" on the first server as
well as a "delete" action on the "metadata" of the second server, or
any other combination of these fields, using the same access token.
To request a different combination of access, such as requesting one
"action" against one "location" and a different "action" against a
different "location", the RC can include multiple separate objects in
the "resources" array. The following non-normative example uses the
same fictitious "photo-api" type definition to request a single
access token with more specifically targeted access rights by using
two discrete objects within the request.
"resources": [
{
"type": "photo-api",
"actions": [
"read"
],
"locations": [
"https://server.example.net/"
],
"datatypes": [
"images"
]
},
{
"type": "photo-api",
"actions": [
"write",
"delete"
],
"locations": [
"https://resource.local/other"
],
"datatypes": [
"metadata"
]
}
]
The access requested here is for "read" access to "images" on one
server while simultaneously requesting "write" and "delete" access
for "metadata" on a different server, but importantly without
requesting "write" or "delete" access to "images" on the first
server.
It is anticipated that API designers will use a combination of common
fields defined in this specification as well as fields specific to
the API itself. The following non-normative example shows the use of
both common and API-specific fields as part of two different
fictitious API "type" values. The first access request includes the
"actions", "locations", and "datatypes" fields specified here as well
as the API-specific "geolocation" field. The second access request
includes the "actions" and "identifier" fields specified here as well
as the API-specific "currency" field.
"resources": [
{
"type": "photo-api",
"actions": [
"read",
"write"
],
"locations": [
"https://server.example.net/",
"https://resource.local/other"
],
"datatypes": [
"metadata",
"images"
],
"geolocation": [
{ lat: -32.364, lng: 153.207 },
{ lat: -35.364, lng: 158.207 }
]
}, },
{ {
"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"
} }
] ]
If this request is approved, the resulting access token If this request is approved, the resulting access token
(Section 3.2.1) will include the sum of both of the requested types (Section 3.2.1)'s access rights will be the union of the requested
of access. types of access for each of the two APIs, just as above.
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 client instance MAY send a string known to the AS
representing the access being requested. Each string SHOULD or RS 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.
[[ See issue #35 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/35) ]]
"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 client instance and MAY be any valid JSON
therefore could include spaces, unicode characters, and properly string, and therefore could include spaces, unicode characters, and
escaped string sequences. However, in some situations the value is properly escaped string sequences. However, in some situations the
intended to be seen and understood be the RC developer. In such value is intended to be seen and understood by the client software's
cases, the API designer choosing any such human-readable strings developer. In such cases, the API designer choosing any such human-
SHOULD take steps to ensure the string values are not easily confused readable strings SHOULD take steps to ensure the string values are
by a developer not easily confused by a developer, such as by limiting the strings
to easily disambiguated characters.
This functionality is similar in practice to OAuth 2's "scope" This functionality is similar in practice to OAuth 2's "scope"
parameter [RFC6749], where a single string represents the set of parameter [RFC6749], where a single string represents the set of
access rights requested by the RC. As such, the reference string access rights requested by the client instance. As such, the
could contain any valid OAuth 2 scope value as in Appendix D.2. Note reference string could contain any valid OAuth 2 scope value as in
that the reference string here is not bound to the same character Appendix D.2. Note that the reference string here is not bound to
restrictions as in OAuth 2's "scope" definition. the same character restrictions as in OAuth 2's "scope" definition.
A single "resources" array MAY include both object-type and string- A single "resources" array MAY include both object-type and string-
type resource items. type resource items. In this non-normative example, the RC is
requesting access to a "photo-api" and "financial-transaction" API
type as well as the reference values of "read", "dolphin-metadata",
and "some other thing".
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
"read", "read",
"write", "write",
"dolphin" "delete"
], ],
"locations": [ "locations": [
"https://server.example.net/", "https://server.example.net/",
"https://resource.local/other" "https://resource.local/other"
], ],
"datatypes": [ "datatypes": [
"metadata", "metadata",
"images" "images"
] ]
}, },
skipping to change at page 22, line 49 skipping to change at page 26, line 5
"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"
] ]
[[ See issue #36 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ The requested access is the union of all elements of the array,
issues/36) ]] including both objects and reference strings.
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 client instance, and MAY be any valid string. The
JSON object fields are JSON arrays representing a single access token values of the JSON object fields are JSON arrays representing a
request, as specified in requesting a single access token single access token request, as specified in requesting a single
(Section 2.1.1). access token (Section 2.1.1).
The following non-normative example shows a request for two separate The following non-normative example shows a request for two separate
access tokens, "token1" and "token2". access tokens, "token1" and "token2".
"resources": { "resources": {
"token1": [ "token1": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
"read", "read",
skipping to change at page 25, line 8 skipping to change at page 28, line 8
] ]
} }
Any approved access requests are returned in the multiple access Any approved access requests are returned in the multiple access
token response (Section 3.2.2) structure using the token identifiers token response (Section 3.2.2) structure using the token identifiers
in the request. in the request.
2.1.4. Signaling Token Behavior 2.1.4. Signaling Token Behavior
While the AS is ultimately in control of how tokens are returned and While the AS is ultimately in control of how tokens are returned and
bound to the RC, sometimes the RC has context about what it can bound to the client instance, sometimes the client instance has
support that can affect the AS's response. This specification context about what it can support that can affect the AS's response.
defines several flags that are passed as resource reference strings This specification defines several flags that are passed as resource
(Section 2.1.2). reference strings (Section 2.1.2).
Each flag applies only to the single resource request in which it Each flag applies only to the single resource request in which it
appears. appears.
Support of all flags is optional, such as any other resource Support of all flags is optional, such as any other resource
reference value. reference value.
multi_token The RC wishes to support multiple simultaneous access multi_token The client instance wishes to support multiple
tokens through the token rotation process. When the RC rotates an simultaneous access tokens through the token rotation process.
access token (Section 6.1), the AS does not invalidate the When the client instance rotates an access token (Section 6.1),
previous access token. The old access token continues to remain the AS does not invalidate the previous access token. The old
valid until such time as it expires or is revoked through other access token continues to remain valid until such time as it
means. expires or is revoked through other means.
split_token The RC is capable of receiving multiple access tokens split_token The client instance is capable of receiving multiple
(Section 3.2.2) in response to any single token request access tokens (Section 3.2.2) in response to any single token
(Section 2.1.1), or receiving a different number of tokens than request (Section 2.1.1), or receiving a different number of tokens
specified in the multiple token request (Section 2.1.3). The than 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 client instance MUST be able to tell from the token response
it can use each of the access tokens. [[ See issue #37 where and how it can use each of the access tokens. [[ See issue
(https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/37) ]] #37 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/37)
]]
bind_token The RC wants the issued access token to be bound to the bind_token The client instance wants the issued access token to be
key the RC used (Section 2.3.2) to make the request. The bound to the key the client instance used (Section 2.3.2) to make
resulting access token MUST be bound using the same "proof" the request. The resulting access token MUST be bound using the
mechanism used by the client with a "key" value of "true", same "proof" mechanism used by the client instance with a "key"
indicating the client's presented key is to be used for binding. value of "true", indicating the client instance's presented key is
[[ See issue #38 (https://github.com/ietf-wg-gnap/gnap-core- to be used for binding. [[ See issue #38 (https://github.com/
protocol/issues/38) ]] ietf-wg-gnap/gnap-core-protocol/issues/38) ]]
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 instance's key and should be kept during
rotation.
"resources": [ "resources": [
{ {
"type": "photo-api", "type": "photo-api",
"actions": [ "actions": [
"read", "read",
"write", "write",
"dolphin" "dolphin"
], ],
"locations": [ "locations": [
skipping to change at page 26, line 34 skipping to change at page 29, line 34
"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).
[[ See issue #39 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #39 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/39) ]] issues/39) ]]
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 client instance is requesting information about the RO from
sends a "subject" field as a JSON object. This object MAY contain the AS, it sends a "subject" field as a JSON object. This object MAY
the following fields (or additional fields defined in a registry TBD contain the following fields (or additional fields defined in a
(Section 12)). registry TBD (Section 12)).
sub_ids (array of strings) An array of subject identifier subject sub_ids (array of strings) An array of subject identifier subject
types requested for the RO, as defined by types requested for the RO, as defined by
[I-D.ietf-secevent-subject-identifiers]. [I-D.ietf-secevent-subject-identifiers].
assertions (array of strings) An array of requested assertion assertions (array of strings) An array of requested assertion
formats. Possible values include "id_token" for an [OIDC] ID formats. Possible values include "id_token" for an [OIDC] ID
Token and "saml2" for a SAML 2 assertion. Additional assertion Token and "saml2" for a SAML 2 assertion. Additional assertion
values are defined by a registry TBD (Section 12). [[ See issue values are defined by a registry TBD (Section 12). [[ See issue
#41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41) #41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41)
]] ]]
"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 client instance
is determined positively, the AS MAY return the RO's information in (Section 2.4). If this is determined positively, the AS MAY return
its response (Section 3.4) as requested. the RO's information in its response (Section 3.4) as requested.
Subject identifiers requested by the RC serve only to identify the RO Subject identifiers requested by the client instance serve only to
in the context of the AS and can't be used as communication channels identify the RO in the context of the AS and can't be used as
by the RC, as discussed in Section 3.4. One method of requesting communication channels by the client instance, as discussed in
communication channels and other identity claims are discussed in Section 3.4.
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.
[[ See issue #42 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #42 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/42) ]] issues/42) ]]
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.
[[ See issue #43 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #43 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/43) ]] issues/43) ]]
2.3. Identifying the RC 2.3. Identifying the Client Instance
When sending a non-continuation request to the AS, the RC MUST When sending a non-continuation request to the AS, the client
identify itself by including the "client" field of the request and by instance MUST identify itself by including the "client" field of the
signing the request as described in Section 8. Note that for a request and by signing the request as described in Section 8. Note
continuation request (Section 5), the RC instance is identified by that for a continuation request (Section 5), the client instance is
its association with the request being continued and so this field is identified by its association with the request being continued and so
not sent under those circumstances. this field is not sent under those circumstances.
When RC information is sent by value, the "client" field of the When client instance information is sent by value, the "client" field
request consists of a JSON object with the following fields. of the request consists of a JSON object with the following fields.
key (object / string) The public key of the RC to be used in this key (object / string) The public key of the client instance to be
request as described in Section 2.3.2. This field is REQUIRED. used in this request as described in Section 2.3.2. This field is
REQUIRED.
class_id (string) An identifier string that the AS can use to class_id (string) An identifier string that the AS can use to
identify the software comprising this instance of the RC. The identify the client software comprising this client instance. The
contents and format of this field are up to the AS. This field is contents and format of this field are up to the AS. This field is
OPTIONAL. OPTIONAL.
display (object) An object containing additional information that display (object) An object containing additional information that
the AS MAY display to the RO during interaction, authorization, the AS MAY display to the RO during interaction, authorization,
and management. This field is OPTIONAL. and management. This field is OPTIONAL.
"client": { "client": {
"key": { "key": {
"proof": "httpsig", "proof": "httpsig",
skipping to change at page 28, line 33 skipping to change at page 31, line 33
}, },
"class_id": "web-server-1234", "class_id": "web-server-1234",
"display": { "display": {
"name": "My Client Display Name", "name": "My Client Display Name",
"uri": "https://example.net/client" "uri": "https://example.net/client"
} }
} }
Additional fields are defined in a registry TBD (Section 12). Additional fields are defined in a registry TBD (Section 12).
The RC MUST prove possession of any presented key by the "proof" The client instance MUST prove possession of any presented key by the
mechanism associated with the key in the request. Proof types are "proof" mechanism associated with the key in the request. Proof
defined in a registry TBD (Section 12) and an initial set of methods types are defined in a registry TBD (Section 12) and an initial set
is described in Section 8. of methods is described in Section 8.
Note that the AS MAY know the RC's public key ahead of time, and the Note that the AS MAY know the client instance's public key ahead of
AS MAY apply different policies to the request depending on what has time, and the AS MAY apply different policies to the request
been registered against that key. If the same public key is sent by depending on what has been registered against that key. If the same
value on subsequent access requests, the AS SHOULD treat these public key is sent by value on subsequent access requests, the AS
requests as coming from the same RC software instance for purposes of SHOULD treat these requests as coming from the same client instance
identification, authentication, and policy application. If the AS for purposes of identification, authentication, and policy
does not know the RC's public key ahead of time, the AS MAY accept or application. If the AS does not know the client instance's public
reject the request based on AS policy, attestations within the client key ahead of time, the AS MAY accept or reject the request based on
request, and other mechanisms. AS policy, attestations within the "client" request, and other
mechanisms.
[[ See issue #44 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #44 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/44) ]] issues/44) ]]
2.3.1. Identifying the RC Instance 2.3.1. Identifying the Client Instance
If the RC has an instance identifier that the AS can use to determine If the client instance has an instance identifier that the AS can use
appropriate key information, the RC can send this value in the to determine appropriate key information, the client instance can
"instance_id" field. The instance identifier MAY be assigned to an send this value in the "instance_id" field. The instance identifier
RC instance at runtime through the Section 3.5 or MAY be obtained in MAY be assigned to a client instance at runtime through the
another fashion, such as a static registration process at the AS. Section 3.5 or MAY be obtained in another fashion, such as a static
registration process at the AS.
instance_id (string) An identifier string that the AS can use to instance_id (string) An identifier string that the AS can use to
identify the particular instance of this RC. The content and identify the particular instance of this client software. The
structure of this identifier is opaque to the RC. content and structure of this identifier is opaque to the client
instance.
"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 client instance MAY
instance identifier as a direct reference value in lieu of the send the instance identifier as a direct reference value in lieu of
object. the 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.
[[ See issue #45 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #45 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/45) ]] issues/45) ]]
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 client instance is identified in this manner, the registered
for the RC MAY be a symmetric key known to the AS. The RC MUST NOT key for the client instance MAY be a symmetric key known to the AS.
send a symmetric key by value in the request, as doing so would The client instance MUST NOT send a symmetric key by value in the
expose the key directly instead of proving possession of it. request, as doing so would expose the key directly instead of proving
possession of it.
[[ See issue #46 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/46) ]]
2.3.2. Identifying the RC Key 2.3.2. Identifying the Client Instance Key
The RC key MUST be a public key in at least one supported format and The client instance key MUST be a public key in at least one
MUST be applicable to the proofing mechanism used in the request. If supported format and MUST be applicable to the proofing mechanism
the key is sent in multiple formats, all the keys MUST be the same. used in the request. If the key is sent in multiple formats, all the
The key presented in this field MUST be the key used to sign the keys MUST be the same. The key presented in this field MUST be the
request. key used to sign the request.
proof (string) The form of proof that the RC will use when proof (string) The form of proof that the client instance will use
presenting the key to the AS. The valid values of this field and when presenting the key to the AS. The valid values of this field
the processing requirements for each are detailed in Section 8. and the processing requirements for each are detailed in
This field is REQUIRED. Section 8. This field is REQUIRED.
jwk (object) Value of the public key as a JSON Web Key. MUST contain jwk (object) Value of the public key as a JSON Web Key. MUST contain
an "alg" field which is used to validate the signature. MUST an "alg" field which is used to validate the signature. MUST
contain the "kid" field to identify the key in the signed object. contain the "kid" field to identify the key in the signed object.
cert (string) PEM serialized value of the certificate used to sign cert (string) PEM serialized value of the certificate used to sign
the request, with optional internal whitespace. the request, with optional internal whitespace.
cert#S256 (string) The certificate thumbprint calculated as per cert#S256 (string) The certificate thumbprint calculated as per
OAuth-MTLS [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).
[[ See issue #47 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/47) ]]
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",
"alg": "RS256", "alg": "RS256",
"n": "kOB5rR4Jv0GMeLaY6_It_r3ORwdf8ci_JtffXyaSx8xY..." "n": "kOB5rR4Jv0GMeLaY6_It_r3ORwdf8ci_JtffXyaSx8xY..."
}, },
"cert": "MIIEHDCCAwSgAwIBAgIBATANBgkqhkiG9w0BAQsFA..." "cert": "MIIEHDCCAwSgAwIBAgIBATANBgkqhkiG9w0BAQsFA..."
} }
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 Client Instance Information
If the RC has additional information to display to the RO during any If the client instance has additional information to display to the
interactions at the AS, it MAY send that information in the "display" RO during any interactions at the AS, it MAY send that information in
field. This field is a JSON object that declares information to the "display" field. This field is a JSON object that declares
present to the RO during any interactive sequences. information to present to the RO during any interactive sequences.
name (string) Display name of the RC software name (string) Display name of the client software
uri (string) User-facing web page of the RC software uri (string) User-facing web page of the client software
logo_uri (string) Display image to represent the RC software logo_uri (string) Display image to represent the client software
"display": { "display": {
"name": "My Client Display Name", "name": "My Client Display Name",
"uri": "https://example.net/client" "uri": "https://example.net/client"
} }
[[ See issue #48 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #48 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/48) ]] issues/48) ]]
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 client instance's identity or source. The AS
display values to specific RC instances, as identified by their keys MAY restrict display values to specific client instances, as
in Section 2.3. identified by their keys in Section 2.3.
2.3.4. Authenticating the RC 2.3.4. Authenticating the Client Instance
If the presented key is known to the AS and is associated with a If the presented key is known to the AS and is associated with a
single instance of the RC software, the process of presenting a key single instance of the client software, the process of presenting a
and proving possession of that key is sufficient to authenticate the key and proving possession of that key is sufficient to authenticate
RC to the AS. The AS MAY associate policies with the RC software the client instance to the AS. The AS MAY associate policies with
identified by this key, such as limiting which resources can be the client instance identified by this key, such as limiting which
requested and which interaction methods can be used. For example, resources can be requested and which interaction methods can be used.
only specific RCs with certain known keys might be trusted with For example, only specific client instances with certain known keys
access tokens without the AS interacting directly with the RO as in might be trusted with access tokens without the AS interacting
Appendix D. directly with the RO as in Appendix D.
The presentation of a key allows the AS to strongly associate The presentation of a key allows the AS to strongly associate
multiple successive requests from the same RC with each other. This multiple successive requests from the same client instance with each
is true when the AS knows the key ahead of time and can use the key other. This is true when the AS knows the key ahead of time and can
to authenticate the RC software, but also if the key is ephemeral and use the key to authenticate the client instance, but also if the key
created just for this series of requests. As such the AS MAY allow is ephemeral and created just for this series of requests. As such
for RCs to make requests with unknown keys. This pattern allows for the AS MAY allow for client instances to make requests with unknown
ephemeral RCs, such as single-page applications, and RCs with many keys. This pattern allows for ephemeral client instances, such as
individual instances, such as mobile applications, to generate their single-page applications, and client software with many individual
own key pairs and use them within the protocol without having to go long-lived instances, such as mobile applications, to generate key
through a separate registration step. The AS MAY limit which pairs per instance and use the keys within the protocol without
capabilities are made available to RCs with unknown keys. For having to go through a separate registration step. The AS MAY limit
example, the AS could have a policy saying that only previously- which capabilities are made available to client instances with
registered RCs can request particular resources, or that all RCs with unknown keys. For example, the AS could have a policy saying that
unknown keys have to be interactively approved by an RO. only previously-registered client instances can request particular
resources, or that all client instances with 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 client instance knows the identity of the RQ through one or
identifiers or assertions, the RC MAY send that information to the AS more identifiers or assertions, the client instance MAY send that
in the "user" field. The RC MAY pass this information by value or by information to the AS in the "user" field. The client instance MAY
reference. pass this information by value or by reference.
sub_ids (array of strings) An array of subject identifiers for the sub_ids (array of strings) An array of subject identifiers for the
RQ, as defined by [I-D.ietf-secevent-subject-identifiers]. RQ, as defined by [I-D.ietf-secevent-subject-identifiers].
assertions (object) An object containing assertions as values keyed assertions (object) An object containing assertions as values keyed
on the assertion type defined by a registry TBD (Section 12). on the assertion type defined by a registry TBD (Section 12).
Possible keys include "id_token" for an [OIDC] ID Token and Possible keys include "id_token" for an [OIDC] ID Token and
"saml2" for a SAML 2 assertion. Additional assertion values are "saml2" for a SAML 2 assertion. Additional assertion values are
defined by a registry TBD (Section 12). [[ See issue #41 defined by a registry TBD (Section 12). [[ See issue #41
(https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41) ]] (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/41) ]]
skipping to change at page 32, line 41 skipping to change at page 35, line 43
"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 client instance and acting as the RQ. Assertions
validated by the AS. [[ See issue #49 (https://github.com/ietf-wg- SHOULD be validated by the AS. [[ See issue #49 (https://github.com/
gnap/gnap-core-protocol/issues/49) ]] ietf-wg-gnap/gnap-core-protocol/issues/49) ]]
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.
[[ See issue #50 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #50 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/50) ]] issues/50) ]]
If the AS trusts the RC to present verifiable assertions, the AS MAY If the AS trusts the client instance to present verifiable
decide, based on its policy, to skip interaction with the RO, even if assertions, the AS MAY decide, based on its policy, to skip
the RC provides one or more interaction modes in its request. interaction with the RO, even if the client instance 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 client instance to represent the same RQ
subsequent requests. to the AS over subsequent requests.
If the RC has a reference for the RQ at this AS, the RC MAY pass that If the client instance has a reference for the RQ at this AS, the
reference as a string. The format of this string is opaque to the client instance MAY pass that reference as a string. The format of
RC. this string is opaque to the client instance.
"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 client instance to
these, use the full user request object (Section 2.4) instead. send either of these, use the full user request object (Section 2.4)
instead.
[[ See issue #51 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #51 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/51) ]] issues/51) ]]
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 client instance for both
direct claim information. Many times the RQ using the RC is the same resources and direct claim information. Many times the RQ using the
person as the RO, and the RC can directly drive interaction with the client instance is the same person as the RO, and the client instance
AS by redirecting the RQ on the same device, or by launching an can directly drive interaction with the AS by redirecting the RQ on
application. Other times, the RC can provide information to start the same device, or by launching an application. Other times, the
the RO's interaction on a secondary device, or the RC will wait for client instance can provide information to start the RO's interaction
the RO to approve the request asynchronously. The RC could also be on a secondary device, or the client instance will wait for the RO to
signaled that interaction has completed by the AS making callbacks. approve the request asynchronously. The client instance could also
To facilitate all of these modes, the RC declares the means that it be signaled that interaction has completed by the AS making
can interact using the "interact" field. callbacks. To facilitate all of these modes, the client instance
declares the means that it can interact using the "interact" field.
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 client instance MUST NOT declare an
mode it does not support. The RC MAY send multiple modes in the same interaction mode it does not support. The client instance MAY send
request. There is no preference order specified in this request. An multiple modes in the same request. There is no preference order
AS MAY respond to any, all, or none of the presented interaction specified in this request. An AS MAY respond to any, all, or none of
modes (Section 3.3) in a request, depending on its capabilities and the presented interaction modes (Section 3.3) in a request, depending
what is allowed to fulfill the request. This specification defines on its capabilities and what is allowed to fulfill the request. This
the following interaction modes: specification defines the following interaction modes:
redirect (boolean) Indicates that the RC can direct the RQ to an redirect (boolean) Indicates that the client instance can direct the
arbitrary URL at the AS for interaction. Section 2.5.1 RQ to an arbitrary URL at the AS for interaction. Section 2.5.1
app (boolean) Indicates that the RC can launch an application on the app (boolean) Indicates that the client instance can launch an
RQ's device for interaction. Section 2.5.2 application on the RQ's device for interaction. Section 2.5.2
callback (object) Indicates that the RC can receive a callback from callback (object) Indicates that the client instance can receive a
the AS after interaction with the RO has concluded. Section 2.5.3 callback from the AS after interaction with the RO has concluded.
Section 2.5.3
user_code (boolean) Indicates that the RC can communicate a human- user_code (boolean) Indicates that the client instance can
readable short code to the RQ for use with a stable URL at the AS. communicate a human-readable short code to the RQ for use with a
Section 2.5.4 stable URL at the AS. Section 2.5.4
ui_locales (array of strings) Indicates the RQ's preferred locales ui_locales (array of strings) Indicates the RQ's preferred locales
that the AS can use during interaction, particularly before the RO that the AS can use during interaction, particularly before the RO
has authenticated. 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).
[[ See issue #52 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ In this non-normative example, the client instance is indicating that
issues/52) ]] it can redirect (Section 2.5.1) the RQ to an arbitrary URL and can
receive a callback (Section 2.5.3) through a browser request.
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
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",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
} }
In this non-normative example, the RC is indicating that it can In this non-normative example, the client instance is indicating that
display a user code (Section 2.5.4) and direct the RQ to an arbitrary it can display a user code (Section 2.5.4) and direct the RQ to an
URL of maximum length (Section 2.5.1.1) 255 characters, but it cannot arbitrary URL (Section 2.5.1) on a secondary device, but it cannot
accept a callback. accept a callback.
"interact": { "interact": {
"redirect": 255, "redirect": true,
"user_code": true "user_code": true
} }
If the RC does not provide a suitable interaction mechanism, the AS If the client instance does not provide a suitable interaction
cannot contact the RO asynchronously, and the AS determines that mechanism, the AS cannot contact the RO asynchronously, and the AS
interaction is required, then the AS SHOULD return an error since the determines that interaction is required, then the AS SHOULD return an
RC will be unable to complete the request without authorization. error since the client instance will be unable to complete the
request without authorization.
The AS SHOULD apply suitable timeouts to any interaction mechanisms The AS SHOULD apply suitable timeouts to any interaction mechanisms
provided, including user codes and redirection URLs. The RC SHOULD provided, including user codes and redirection URLs. The client
apply suitable timeouts to any callback URLs. instance SHOULD apply suitable timeouts to any callback URLs.
2.5.1. Redirect to an Arbitrary URL 2.5.1. Redirect to an Arbitrary URL
If the RC is capable of directing the RQ to a URL defined by the AS If the client instance is capable of directing the RQ to a URL
at runtime, the RC indicates this by sending the "redirect" field defined by the AS at runtime, the client instance indicates this by
with the boolean value "true". The means by which the RC will sending the "redirect" field with the boolean value "true". The
activate this URL is out of scope of this specification, but common means by which the client instance will activate this URL is out of
methods include an HTTP redirect, launching a browser on the RQ's scope of this specification, but common methods include an HTTP
device, providing a scannable image encoding, and printing out a URL redirect, launching a browser on the RQ's device, providing a
to an interactive console. scannable image encoding, and printing out a URL to an interactive
console.
"interact": { "interact": {
"redirect": true "redirect": true
} }
If this interaction mode is supported for this RC and request, the AS If this interaction mode is supported for this client instance and
returns a redirect interaction response Section 3.3.1. request, the AS returns a redirect interaction response
Section 3.3.1.
2.5.1.1. Redirect to an Arbitrary Shortened URL
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
with an integer indicating the maximum character length of the
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
response URL enough to fit in the requested size, the AS SHOULD
return an error. [[ See issue #53 (https://github.com/ietf-wg-gnap/
gnap-core-protocol/issues/53) ]]
"interact": {
"redirect": 255
}
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.
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 client instance can open a URL associated with an application
device, the RC indicates this by sending the "app" field with boolean on the RQ's device, the client instance indicates this by sending the
value "true". The means by which the RC determines the application "app" field with boolean value "true". The means by which the client
to open with this URL are out of scope of this specification. instance determines the application 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 client instance and
returns an app interaction response with an app URL payload request, the AS returns an app interaction response with an app URL
Section 3.3.2. payload Section 3.3.2.
[[ See issue #54 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #54 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/54) ]] issues/54) ]]
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 client instance is capable of receiving a message from the AS
that the RO has completed their interaction, the RC indicates this by indicating that the RO has completed their interaction, the client
sending the "callback" field. The value of this field is an object instance indicates this by sending the "callback" field. The value
containing the following members. of this field is an object containing the following members.
uri (string) 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 client instance. This URI MUST NOT
fragment component. This URI MUST be protected by HTTPS, be contain any fragment component. This URI MUST be protected by
hosted on a server local to the RO's browser ("localhost"), or use HTTPS, be hosted on a server local to the RO's browser
an application-specific URI scheme. If the RC needs any state ("localhost"), or use an application-specific URI scheme. If the
information to tie to the front channel interaction response, it client instance needs any state information to tie to the front
MUST use a unique callback URI to link to that ongoing state. The channel interaction response, it MUST use a unique callback URI to
allowable URIs and URI patterns MAY be restricted by the AS based link to that ongoing state. The allowable URIs and URI patterns
on the RC's presented key information. The callback URI SHOULD be MAY be restricted by the AS based on the client instance's
presented to the RO during the interaction phase before redirect. presented key information. The callback URI SHOULD be presented
[[ See issue #55 (https://github.com/ietf-wg-gnap/gnap-core- to the RO during the interaction phase before redirect. [[ See
protocol/issues/55) ]] issue #55 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/55) ]]
nonce (string) REQUIRED. Unique value to be used in the calculation nonce (string) REQUIRED. Unique value to be used in the calculation
of the "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 client instance as a unique value for this
request.
method (string) REQUIRED. The callback method that the AS will use method (string) REQUIRED. The callback method that the AS will use
to contact the RC. Valid values include "redirect" to contact the client instance. Valid values include "redirect"
Section 2.5.3.1 and "push" Section 2.5.3.2, with other values Section 2.5.3.1 and "push" Section 2.5.3.2, with other values
defined by a registry TBD (Section 12). defined by a registry TBD (Section 12).
hash_method (string) OPTIONAL. The hash calculation mechanism to be hash_method (string) OPTIONAL. The hash calculation mechanism to be
used for the callback hash in Section 4.4.3. Can be one of "sha3" used for the callback hash in Section 4.4.3. Can be one of "sha3"
or "sha2". If absent, the default value is "sha3". [[ See issue or "sha2". If absent, the default value is "sha3". [[ See issue
#56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/56) #56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/56)
]] ]]
"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 client instance and
If this interaction mode is supported for this RC and request, the AS request, the AS returns a nonce for use in validating the callback
returns a nonce for use in validating the callback response response (Section 3.3.3). Requests to the callback URI MUST be
(Section 3.3.3). Requests to the callback URI MUST be processed as processed as described in Section 4.4, and the AS MUST require
described in Section 4.4, and the AS MUST require presentation of an presentation of an interaction callback reference as described in
interaction callback reference as described in Section 5.1. Section 5.1.
[[ See issue #58 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #58 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/58) ]] issues/58) ]]
[[ See issue #59 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #59 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/59) ]] 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 client
expect a call from the RO's browser using the HTTP method GET as instance will expect a call from the RO's browser using the HTTP
described in Section 4.4.1. method GET as described in Section 4.4.1.
"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"
} }
} }
Requests to the callback URI MUST be processed by the RC as described Requests to the callback URI MUST be processed by the client instance
in Section 4.4.1. as described in Section 4.4.1.
Since the incoming request to the callback URL is from the RO's Since the incoming request to the callback URL is from the RO's
browser, this method is usually used when the RO and RQ are the same browser, this method is usually used when the RO and RQ are the same
entity. As such, the RC MUST ensure the RQ is present on the request entity. As such, the client instance MUST ensure the RQ is present
to prevent substitution attacks. on the request to prevent substitution attacks.
2.5.3.2. Receive an HTTP Direct Callback 2.5.3.2. Receive an HTTP Direct Callback
A callback "method" value of "push" indicates that the RC will expect A callback "method" value of "push" indicates that the client
a call from the AS directly using the HTTP method POST as described instance will expect a call from the AS directly using the HTTP
in Section 4.4.2. method POST as described in Section 4.4.2.
"interact": { "interact": {
"callback": { "callback": {
"method": "push", "method": "push",
"uri": "https://client.example.net/return/123455", "uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
} }
Requests to the callback URI MUST be processed by the client instance
Requests to the callback URI MUST be processed by the RC as described 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 client instance MUST NOT require the RQ to
on the incoming HTTP request. be present on the incoming HTTP request.
[[ See issue #60 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #60 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/60) ]] issues/60) ]]
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 client instance is capable of displaying or otherwise
short, human-entered code to the RO, the RC indicates this by sending communicating a short, human-entered code to the RO, the client
the "user_code" field with the boolean value "true". This code is to instance indicates this by sending the "user_code" field with the
be entered at a static URL that does not change at runtime, as boolean value "true". This code is to be entered at a static URL
described in Section 3.3.4. that does not change at runtime, as described in Section 3.3.4.
"interact": { "interact": {
"user_code": true "user_code": true
} }
If this interaction mode is supported for this RC and request, the AS If this interaction mode is supported for this client instance and
returns a user code and interaction URL as specified in Section 4.2. request, the AS returns a user code and interaction URL as specified
in Section 4.2.
2.5.5. Indicate Desired Interaction Locales 2.5.5. Indicate Desired Interaction Locales
If the RC knows the RQ's locale and language preferences, the RC can If the client instance knows the RQ's locale and language
send this information to the AS using the "ui_locales" field with an preferences, the client instance can send this information to the AS
array of locale strings as defined by [RFC5646]. using the "ui_locales" field with an array of locale strings as
defined by [RFC5646].
"interact": { "interact": {
"ui_locales": ["en-US", "fr-CA"] "ui_locales": ["en-US", "fr-CA"]
} }
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).
skipping to change at page 39, line 14 skipping to change at page 42, line 5
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).
[[ See issue #61 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ 2.6. Declaring Client Capabilities
issues/61) ]]
2.6. Declaring RC Capabilities
If the RC supports extension capabilities, it MAY present them to the If the client software supports extension capabilities, the client
AS in the "capabilities" field. This field is an array of strings instance MAY present them to the AS in the "capabilities" field.
representing specific extensions and capabilities, as defined by a This field is an array of strings representing specific extensions
registry TBD (Section 12). and capabilities, as defined by a registry TBD (Section 12).
"capabilities": ["ext1", "ext2"] "capabilities": ["ext1", "ext2"]
2.7. Referencing an Existing Grant Request 2.7. Referencing an Existing Grant Request
If the RC has a reference handle from a previously granted request, If the client instance has a reference handle from a previously
it MAY send that reference in the "existing_grant" field. This field granted request, it MAY send that reference in the "existing_grant"
is a single string consisting of the "value" of the "access_token" field. This field is a single string consisting of the "value" of
returned in a previous request's continuation response (Section 3.1). the "access_token" 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.
[[ See issue #62 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #62 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/62) ]] issues/62) ]]
2.8. Requesting OpenID Connect Claims 2.8. Extending The Grant Request
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
OpenID Connect "claims" authorization request parameter as a JSON
object under the name "claims" in the root of the request.
"claims": {
"id_token" : {
"email" : { "essential" : true },
"email_verified" : { "essential" : true }
},
"userinfo" : {
"name" : { "essential" : true },
"picture" : null
}
}
The contents of the "claims" parameter have the same semantics as
they do in OpenID Connect's "claims" authorization request parameter,
including all extensions such as [OIDC4IA]. The AS MUST process the
claims object in the same way that it would with an OAuth 2 based
authorization request.
Note that because this is an independent query object, the "claims"
value can augment or alter other portions of the request, namely the
"resources" and "subject" fields. This query language uses the
fields in the top level of the object to indicate the target for any
requested claims. For instance, the "userinfo" target indicates that
a returned access token would grant access to the given claims at 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.
[[ See issue #63 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/63) ]]
[[ See issue #64 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/64) ]]
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.
[[ See issue #65 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
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 client instance's request, the AS responds with a
the HTTP entity body. Each possible field is detailed in the JSON object as the HTTP entity body. Each possible field is detailed
sections below in the sections below
continue (object) Indicates that the RC can continue the request by
making an additional request using these parameters. Section 3.1
access_token (object) A single access token that the RC can use to continue (object) Indicates that the client instance can continue
call the RS on behalf of the RO. Section 3.2.1 the request by making one or more continuation requests.
Section 3.1
access_token (object) A single access token that the client instance
can use to call the RS on behalf of the RO. Section 3.2.1
multiple_access_token (object) Multiple named access tokens that the multiple_access_token (object) Multiple named access tokens that the
RC can use to call the RS on behalf of the RO. Section 3.2.2 client instance can use to call the RS on behalf of the RO.
Section 3.2.2
interact (object) Indicates that interaction through some set of interact (object) Indicates that interaction through some set of
defined mechanisms needs to take place. Section 3.3 defined mechanisms needs to take place. Section 3.3
subject (object) Claims about the RO as known and declared by the subject (object) Claims about the RO as known and declared by the
AS. Section 3.4 AS. Section 3.4
instance_id (string) An identifier this RC instance can use to instance_id (string) An identifier this client instance instance can
identify itself when making future requests. Section 3.5 use to identify itself when making future requests. Section 3.5
user_handle (string) An identifier this RC instance can use to user_handle (string) An identifier this client instance instance can
identify its current RQ when making future requests. Section 3.5 use to identify its current RQ when making future requests.
Section 3.5
error (object) An error code indicating that something has gone error (object) An error code indicating that something has gone
wrong. 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). response (Section 3.1).
{ {
"interact": { "interact": {
"redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ", "redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ",
"callback": "MBDOFXG4Y5CVJCX821LH" "callback": "MBDOFXG4Y5CVJCX821LH"
}, },
"continue": { "continue": {
"access_token": { "access_token": {
"value": "80UPRY5NM33OMUKMKSKU", "value": "80UPRY5NM33OMUKMKSKU",
"key": true "key": true
skipping to change at page 42, line 25 skipping to change at page 44, 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 (string) REQUIRED. The URI at which the RC can make uri (string) REQUIRED. The URI at which the client instance can
continuation requests. This URI MAY vary per request, or MAY be make continuation requests. This URI MAY vary per request, or MAY
stable at the AS if the AS includes an access token. The RC MUST be stable at the AS if the AS includes an access token. The
use this value exactly as given when making a continuation request client instance MUST use this value exactly as given when making a
(Section 5). continuation request (Section 5).
wait (integer) RECOMMENDED. The amount of time in integer seconds wait (integer) RECOMMENDED. The amount of time in integer seconds
the RC SHOULD wait after receiving this continuation handle and the client instance SHOULD wait after receiving this continuation
calling the URI. handle and calling the URI.
access_token (object) RECOMMENDED. A unique access token for access_token (object) REQUIRED. A unique access token for
continuing the request, in the format specified in Section 3.2.1. continuing the request, in the format specified in Section 3.2.1.
This access token MUST be bound to the RC's key used in the This access token MUST be bound to the client instance's key used
request and MUST NOT be a "bearer" token. This access token MUST in the request and MUST NOT be a "bearer" token. As a
NOT be usable at resources outside of the AS. If the AS includes consequence, the "key" field of this access token is always the
an access token, the RC MUST present the access token in all boolean value "true". This access token MUST NOT be usable at
requests to the continuation URI as described in Section 7. [[ resources outside of the AS. The client instance MUST present the
See issue #66 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ access token in all requests to the continuation URI as described
issues/66) ]] 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
} }
} }
The RC can use the values of this field to continue the request as The client instance can use the values of this field to continue the
described in Section 5. Note that the RC MUST sign all continuation request as described in Section 5. Note that the client instance
requests with its key as described in Section 8. If the AS includes MUST sign all continuation requests with its key as described in
an "access_token", the RC MUST present the access token in its Section 8 and MUST present the access token in its continuation
continuation request. 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 client instance to follow up after interaction has been
concluded.
[[ See issue #67 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/67) ]]
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 client instance, the AS responds with either the "access_token" or
"multiple_access_token" field. The AS MUST NOT respond with both the the "multiple_access_token" field. The AS MUST NOT respond with both
"access_token" and "multiple_access_token" fields. the "access_token" and "multiple_access_token" fields.
[[ See issue #68 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #68 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/68) ]] issues/68) ]]
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 client instance has requested a single access token and the AS
that access token, the AS responds with the "access_token" field. has granted that access token, the AS responds with the
The value of this field is an object with the following properties. "access_token" field. The value of this field is an object with the
following properties.
value (string) REQUIRED. The value of the access token as a string. value (string) REQUIRED. The value of the access token as a string.
The value is opaque to the RC. The value SHOULD be limited to The value is opaque to the client instance. The value SHOULD be
ASCII characters to facilitate transmission over HTTP headers limited to ASCII characters to facilitate transmission over HTTP
within other protocols without requiring additional encoding. headers within other protocols without requiring additional
encoding.
manage (string) OPTIONAL. The management URI for this access token. manage (string) OPTIONAL. The management URI for this access token.
If provided, the RC MAY manage its access token as described in If provided, the client instance MAY manage its access token as
Section 6. This management URI is a function of the AS and is described in Section 6. This management URI is a function of the
separate from the RS the RC is requesting access to. This URI AS and is separate from the RS the client instance is requesting
MUST NOT include the access token value and SHOULD be different access to. This URI MUST NOT include the access token value and
for each access token issued in a request. SHOULD be different for each access token issued in a request.
resources (array of objects/strings) RECOMMENDED. A description of resources (array of objects/strings) RECOMMENDED. A description of
the rights associated with this access token, as defined in the rights associated with this access token, as defined in
Section 2.1.1. If included, this MUST reflect the rights Section 2.1.1. If included, this MUST reflect the rights
associated with the issued access token. These rights MAY vary associated with the issued access token. These rights MAY vary
from what was requested by the RC. from what was requested by the client instance.
expires_in (integer) OPTIONAL. The number of seconds in which the expires_in (integer) OPTIONAL. The number of seconds in which the
access will expire. The RC MUST NOT use the access token past access will expire. The client instance MUST NOT use the access
this time. An RS MUST NOT accept an access token past this time. token past this time. An RS MUST NOT accept an access token past
Note that the access token MAY be revoked by the AS or RS at any this time. Note that the access token MAY be revoked by the AS or
point prior to its expiration. RS at any point prior to its expiration.
key (object / string / boolean) REQUIRED. The key that the token is key (object / string / boolean) REQUIRED. The key that the token is
bound to. If the boolean value "true" is used, the token is bound bound to. If the boolean value "true" is used, the token is bound
to the key used by the RC (Section 2.3.2) in its request for to the key used by the client instance (Section 2.3.2) in its
access. If the boolean value "false" is used, the token is a request for access. If the boolean value "false" is used, the
bearer token with no key bound to it. Otherwise, the key MUST be token is a bearer token with no key bound to it. Otherwise, the
an object or string in a format described in Section 2.3.2, key MUST be an object or string in a format described in
describing a public key to which the RC can use the associated Section 2.3.2, describing a public key to which the client
private key. The RC MUST be able to dereference or process the instance can use the associated private key. The client instance
key information in order to be able to sign the request. MUST be able to dereference or process the 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 45, line 31 skipping to change at page 47, line 31
"datatypes": [ "datatypes": [
"metadata", "metadata",
"images" "images"
] ]
}, },
"read", "dolphin-metadata" "read", "dolphin-metadata"
] ]
} }
The following non-normative example shows a single access token bound The following non-normative example shows a single access token bound
to the RC's key, which was presented using the detached JWS to the client instance's key, which was presented using the detached
(Section 8.1) binding method. JWS (Section 8.1) binding method.
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"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 client instance requested multiple access tokens
MUST NOT respond with a single access token structure unless the RC (Section 2.1.3), the AS MUST NOT respond with a single access token
sends the "split_token" flag as described in Section 2.1.4. structure unless the client instance sends the "split_token" flag as
described in Section 2.1.4.
[[ See issue #69 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #69 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/69) ]] issues/69) ]]
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 client instance has requested multiple access tokens and the
at least one of them, the AS responds with the AS has granted 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 client instance 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.
In this non-normative example, two bearer tokens are issued under the In this non-normative example, two bearer tokens are issued under the
names "token1" and "token2", and only the first token has a names "token1" and "token2", and only the first token has a
management URL associated with it. management URL associated with it.
"multiple_access_tokens": { "multiple_access_tokens": {
"token1": { "token1": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": false, "key": false,
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L" "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L"
}, },
"token2": { "token2": {
"value": "UFGLO2FDAFG7VGZZPJ3IZEMN21EVU71FHCARP4J1", "value": "UFGLO2FDAFG7VGZZPJ3IZEMN21EVU71FHCARP4J1",
"key": false "key": false
} }
} }
Each access token corresponds to the named resources arrays in the Each access token corresponds to the named resources arrays in the
RC's request (Section 2.1.3). client instance's request (Section 2.1.3).
The multiple access token response MUST be used when multiple access The multiple access token response MUST be used when multiple access
tokens are requested, even if only one access token is issued as a tokens are requested, even if only one access token is issued as a
result of the request. The AS MAY refuse to issue one or more of the result of the request. The AS MAY refuse to issue one or more of the
requested access tokens, for any reason. In such cases the refused requested access tokens, for any reason. In such cases the refused
token is omitted from the response and all of the other issued access token is omitted from the response and all of the other issued access
tokens are included in the response the requested names appropriate tokens are included in the response the requested names appropriate
names. names.
If the RC requested a single access token (Section 2.1.1), the AS If the client instance requested a single access token
MUST NOT respond with the multiple access token structure unless the (Section 2.1.1), the AS MUST NOT respond with the multiple access
RC sends the "split_token" flag as described in Section 2.1.4. token structure unless the client instance 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.
[[ See issue #70 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #70 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/70) ]] 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 client instance has indicated a capability to interact with
request (Section 2.5), and the AS has determined that interaction is the RO in its request (Section 2.5), and the AS has determined that
both supported and necessary, the AS responds to the RC with any of interaction is both supported and necessary, the AS responds to the
the following values in the "interact" field of the response. There client instance with any of the following values in the "interact"
is no preference order for interaction modes in the response, and it field of the response. There is no preference order for interaction
is up to the RC to determine which ones to use. All supported modes in the response, and it is up to the client instance to
interaction methods are included in the same "interact" object. determine which ones to use. All supported interaction methods are
included in the same "interact" object.
redirect (string) Redirect to an arbitrary URL. Section 3.3.1 redirect (string) Redirect to an arbitrary URL. Section 3.3.1
app (string) Launch of an application URL. Section 3.3.2 app (string) Launch of an application URL. Section 3.3.2
callback (string) Callback to an RC URL after interaction is callback (string) Callback to a client instance accessible URL after
completed. Section 3.3.3 interaction is completed. Section 3.3.3
user_code (object) 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 client
indicate in its request. The AS MUST NOT respond with any instance did not indicate in its request. The AS MUST NOT respond
interaction mode that the AS does not support. Since interaction with any interaction mode that the AS does not support. Since
responses include secret or unique information, the AS SHOULD respond interaction responses include secret or unique information, the AS
to each interaction mode only once in an ongoing request, SHOULD respond to each interaction mode only once in an ongoing
particularly if the RC modifies its request (Section 5.3). request, particularly if the client instance modifies its request
(Section 5.3).
3.3.1. Redirection to an arbitrary URL 3.3.1. Redirection to an arbitrary URL
If the RC indicates that it can redirect to an arbitrary URL If the client instance indicates that it can redirect to an arbitrary
(Section 2.5.1) and the AS supports this mode for the RC's request, URL (Section 2.5.1) and the AS supports this mode for the client
the AS responds with the "redirect" field, which is a string instance's request, the AS responds with the "redirect" field, which
containing the URL to direct the RQ to. This URL MUST be unique for is a string containing the URL to direct the RQ to. This URL MUST be
the request and MUST NOT contain any security-sensitive information. unique for the request and MUST NOT contain any security-sensitive
information.
"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 client instance uses to
(Section 2), allowing an AS to separate its user-interactive request access (Section 2), allowing an AS to separate its user-
functionality from its back-end security functionality. interactive functionality from its back-end security functionality.
[[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/72) ]] issues/72) ]]
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 The client instance sends the RQ to the URL to interact with the AS.
this URL is out of scope of this specification, but common methods The client instance MUST NOT alter the URL in any way. The means for
include an HTTP redirect, launching the system browser, displaying a the client instance to send the RQ to this URL is out of scope of
scannable code, or printing out the URL in an interactive console. this specification, but common methods include an HTTP redirect,
launching the system browser, displaying a 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 client instance indicates that it can launch an application
(Section 2.5.2) and the AS supports this mode for the RC's request, URL (Section 2.5.2) and the AS supports this mode for the client
the AS responds with the "app" field, which is a string containing instance's request, the AS responds with the "app" field, which is a
the URL to direct the RQ to. This URL MUST be unique for the request string containing the URL to direct the RQ to. This URL MUST be
and MUST NOT contain any security-sensitive information. unique for the request and MUST NOT contain any security-sensitive
information.
"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 client instance launches the URL as appropriate on its platform,
for the RC to launch this URL is out of scope of this specification. and the means for the client instance to launch this URL is out of
The RC MUST NOT alter the URL in any way. The RC MAY attempt to scope of this specification. The client instance MUST NOT alter the
detect if an installed application will service the URL being sent URL in any way. The client instance MAY attempt to detect if an
before attempting to launch the application URL. installed application will service the URL being sent before
attempting to launch the application URL.
[[ See issue #71 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #71 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/71) ]] issues/71) ]]
3.3.3. Post-interaction Callback to an RC URL 3.3.3. Post-interaction Callback to a Client Instance Accessible URL
If the RC indicates that it can receive a post-interaction callback If the client instance indicates that it can receive a
on a URL (Section 2.5.3) and the AS supports this mode for the RC's post-interaction callback on a URL (Section 2.5.3) and the AS
request, the AS responds with a "callback" field containing a nonce supports this mode for the client instance's request, the AS responds
that the RC will use in validating the callback as defined in with a "callback" field containing a nonce that the client instance
Section 4.4.1. will use in validating the callback as defined in Section 4.4.1.
"interact": { "interact": {
"callback": "MBDOFXG4Y5CVJCX821LH" "callback": "MBDOFXG4Y5CVJCX821LH"
} }
[[ See issue #73 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
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 client instance's callback URL using the method indicated in the
(Section 2.5.3) as described in Section 4.4.1. callback request (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 client instance MUST NOT
grant request before it receives the associated interaction reference continue a grant request before it receives the associated
on the callback URI. interaction reference 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 client instance indicates that it can display a short
(Section 2.5.4) and the AS supports this mode for the RC's request, user-typeable code (Section 2.5.4) and the AS supports this mode for
the AS responds with a "user_code" field. This field is an object the client instance's request, the AS responds with a "user_code"
that contains the following members. field. This field is an object that contains the following members.
code (string) REQUIRED. A unique short code that the user can type code (string) REQUIRED. A unique short code that the user can type
into an authorization server. This string MUST be case- into an authorization server. This string MUST be case-
insensitive, MUST consist of only easily typeable characters (such insensitive, MUST consist of only easily typeable characters (such
as letters or numbers). The time in which this code will be as letters or numbers). The time in which this code will be
accepted SHOULD be short lived, such as several minutes. It is accepted SHOULD be short lived, such as several minutes. It is
RECOMMENDED that this code be no more than eight characters in RECOMMENDED that this code be no more than eight characters in
length. length.
url (string) RECOMMENDED. The interaction URL that the RC will url (string) RECOMMENDED. The interaction URL that the client
direct the RO to. This URL MUST be stable at the AS such that RCs instance will direct the RO to. This URL MUST be stable at the AS
can be statically configured with it. such that client instance's 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 client instance MUST communicate the "code" to the RQ in some
displaying it on a screen or reading it out audibly. The "code" is a fashion, such as displaying it on a screen or reading it out audibly.
one-time-use credential that the AS uses to identify the pending The "code" is a one-time-use credential that the AS uses to identify
request from the RC. When the RO enters this code (Section 4.2) into the pending request from the client instance. When the RO enters
the AS, the AS MUST determine the pending request that it was this code (Section 4.2) into the AS, the AS MUST determine the
associated with. If the AS does not recognize the entered code, the pending request that it was associated with. If the AS does not
AS MUST display an error to the user. If the AS detects too many recognize the entered code, the AS MUST display an error to the user.
unrecognized codes entered, it SHOULD display an error to the user. If the AS detects too many unrecognized codes entered, it SHOULD
display an error to the user.
The RC SHOULD also communicate the URL if possible to facilitate user The client instance SHOULD also communicate the URL if possible to
interaction, but since the URL should be stable, the RC should be facilitate user interaction, but since the URL should be stable, the
able to safely decide to not display this value. As this interaction client instance should be able to safely decide to not display this
mode is designed to facilitate interaction via a secondary device, it value. As this interaction mode is designed to facilitate
is not expected that the RC redirect the RQ to the URL given here at interaction via a secondary device, it is not expected that the
runtime. Consequently, the URL needs to be stable enough that a RC client instance redirect the RQ to the URL given here at runtime.
could be statically configured with it, perhaps referring the RQ to Consequently, the URL needs to be stable enough that a client
the URL via documentation instead of through an interactive means. instance could be statically configured with it, perhaps referring
If the RC is capable of communicating an arbitrary URL to the RQ, the RQ to the URL via documentation instead of through an interactive
such as through a scannable code, the RC can use the "redirect" means. If the client instance is capable of communicating an
(Section 2.5.1) mode for this purpose instead of or in addition to arbitrary URL to the RQ, such as through a scannable code, the client
the user code mode. instance can use the "redirect" (Section 2.5.1) mode for this purpose
instead of or in addition to 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 client instance uses to
(Section 2), allowing an AS to separate its user-interactive request access (Section 2), allowing an AS to separate its user-
functionality from its back-end security functionality. interactive functionality from its back-end security functionality.
[[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #72 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/72) ]] issues/72) ]]
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 client
access to that data, the AS returns the approved information in the instance access to that data, the AS returns the approved information
"subject" response field. This field is an object with the following in the "subject" response field. This field is an object with the
OPTIONAL properties. following OPTIONAL properties.
sub_ids (array of strings) An array of subject identifiers for the sub_ids (array of objects) An array of subject identifiers for the
RO, as defined by [I-D.ietf-secevent-subject-identifiers]. [[ See RO, as defined by [I-D.ietf-secevent-subject-identifiers].
issue #74 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/74) ]]
assertions (object) An object containing assertions as values keyed assertions (object) An object containing assertions as values keyed
on the assertion type defined by a registry TBD (Section 12). [[ on the assertion type defined by a registry TBD (Section 12). [[
See issue #41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ See issue #41 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/41) ]] issues/41) ]]
updated_at (string) Timestamp as an ISO8610 date string, indicating updated_at (string) Timestamp as an ISO8610 date string, indicating
when the identified account was last updated. The RC MAY use this when the identified account was last updated. The client instance
value to determine if it needs to request updated profile MAY use this value to determine if it needs to request updated
information through an identity API. The definition of such an profile information through an identity API. The definition of
identity API is out of scope for this specification. such an 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..."
} }
} }
The AS MUST return the "subject" field only in cases where the AS is The AS MUST return the "subject" field only in cases where the AS is
sure that the RO and the RQ are the same party. This can be sure that the RO and the RQ are the same party. This can be
accomplished through some forms of interaction with the RO accomplished through some forms of interaction with the RO
(Section 4). (Section 4).
Subject identifiers returned by the AS SHOULD uniquely identify the Subject identifiers returned by the AS SHOULD uniquely identify the
RO at the AS. Some forms of subject identifier are opaque to the RC RO at the AS. Some forms of subject identifier are opaque to the
(such as the subject of an issuer and subject pair), while others client instance (such as the subject of an issuer and subject pair),
forms (such as email address and phone number) are intended to allow while others forms (such as email address and phone number) are
the RC to correlate the identifier with other account information at intended to allow the client instance to correlate the identifier
the RC. The RC MUST NOT request or use any returned subject with other account information at the client instance. The client
identifiers for communication purposes (see Section 2.2). That is, a instance MUST NOT request or use any returned subject identifiers for
subject identifier returned in the format of an email address or a communication purposes (see Section 2.2). That is, a subject
phone number only identifies the RO to the AS and does not indicate identifier returned in the format of an email address or a phone
that the AS has validated that the represented email address or 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
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 client instance MUST use
protocol to request and receive additional identity claims. While an identity protocol to request and receive additional identity
Section 2.8 specifies one such method, other identity protocols could claims. The details of an identity protocol and associated schema
also be used on top of GNAP to convey this information and the are outside the scope of this specification.
details of an identity protocol and associated schema are outside the
scope of this specification.
[[ See issue #75 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #75 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/75) ]] issues/75) ]]
[[ See issue #74 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/74) ]]
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 client instance's request can be passed as either a
reference. The use of a reference in place of a value allows for a value or a reference. The use of a reference in place of a value
client to optimize requests to the AS. allows for a client instance to optimize requests to the AS.
Some references, such as for the RC instance's identity Some references, such as for the client instance's identity
(Section 2.3.1) or the requested resources (Section 2.1.2), can be (Section 2.3.1) or the requested resources (Section 2.1.2), can be
managed statically through an admin console or developer portal managed statically through an admin console or developer portal
provided by the AS or RS. The developer of the RC can include these provided by the AS or RS. The developer of the client software can
values in their code for a more efficient and compact request. include these values in their code for a more efficient and compact
request.
If desired, the AS MAY also generate and return some of these If desired, the AS MAY also generate and return some of these
references dynamically to the RC in its response to facilitate references dynamically to the client instance in its response to
multiple interactions with the same software. The RC SHOULD use facilitate multiple interactions with the same software. The client
these references in future requests in lieu of sending the associated instance SHOULD use these references in future requests in lieu of
data value. These handles are intended to be used on future sending the associated data value. These handles are intended to be
requests. used on future 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 client instance as secrets. Handle values MUST be
and MUST NOT contain any sensitive information. Handle values are unguessable and MUST NOT contain any sensitive information. Handle
opaque to the RC. values are opaque to the client instance.
[[ See issue #76 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/76) ]]
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 (string) A string value used to represent the instance_id (string) A string value used to represent the
information in the "client" object that the RC can use in a future information in the "client" object that the client instance can
request, as described in Section 2.3.1. use in a future request, as described in Section 2.3.1.
user_handle (string) A string value used to represent the current user_handle (string) A string value used to represent the current
user. The RC can use in a future request, as described in user. The client instance can use in a future request, as
Section 2.4.1. 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
skipping to change at page 53, line 11 skipping to change at page 55, line 11
[[ See issue #77 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #77 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/77) ]] issues/77) ]]
[[ See issue #78 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #78 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/78) ]] issues/78) ]]
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 client instance with an error message.
error (string) 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 client instance 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.
[[ See issue #79 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #79 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/79) ]] issues/79) ]]
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).
[[ 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 client instance indicates that it is capable of driving
the RO in its request (Section 2.5), and the AS determines that interaction with the RO in its request (Section 2.5), and the AS
interaction is required and responds to one or more of the RC's determines that interaction is required and responds to one or more
interaction modes, the RC SHOULD initiate one of the returned of the client instance's interaction modes, the client instance
interaction modes in the response (Section 3.3). SHOULD initiate one of the returned 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
actions it sees fit, including but not limited to: actions it sees fit, including but not limited to:
* authenticate the current user (who may be the RQ) as the RO * authenticate the current user (who may be the RQ) as the RO
* 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
skipping to change at page 54, line 17 skipping to change at page 56, line 14
* 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
[[ See issue #81 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/81) ]]
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 client instance does not add any
URL, the AS MUST determine the grant request being referenced from parameters to the URL, the AS MUST determine the grant request being
the URL value itself. If the URL cannot be associated with a referenced from the URL value itself. If the URL cannot be
currently active request, the AS MUST display an error to the RO and associated with a currently active request, the AS MUST display an
MUST NOT attempt to redirect the RO back to any RC even if a callback error to the RO and MUST NOT attempt to redirect the RO back to any
is supplied (Section 2.5.3). client instance even if a callback is supplied (Section 2.5.3).
The interaction URL MUST be reachable from the RO's browser, though The interaction URL MUST be reachable from the RO's browser, though
note that the RO MAY open the URL on a separate device from the RC note that the RO MAY open the URL on a separate device from the
itself. The interaction URL MUST be accessible from an HTTP GET client instance itself. The interaction URL MUST be accessible from
request, and MUST be protected by HTTPS or equivalent means. an HTTP GET request, and MUST be protected by HTTPS or equivalent
means.
With this method, it is common for the RO to be the same party as the With this method, it is common for the RO to be the same party as the
RQ, since the RC has to communicate the redirection URI to the RQ. RQ, since the client instance has to communicate the redirection URI
to the RQ.
4.2. Interaction at the User Code URI 4.2. Interaction at the User Code URI
When the RO is directed to the AS through the "user_code" When the RO is directed to the AS through the "user_code"
(Section 3.3.4) mode, the AS can interact with the RO through their (Section 3.3.4) mode, the AS can interact with the RO through their
web browser to collect the user code, authenticate the user as an RO, web browser to collect the user code, authenticate the user as an RO,
and gather their consent. Note that since the URL itself is static, and gather their consent. Note that since the URL itself is static,
the AS MUST determine the grant request being referenced from the the AS MUST determine the grant request being referenced from the
user code value itself. If the user code cannot be associated with a user code value itself. If the user code 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
MUST NOT attempt to redirect the RO back to any RC even if a callback MUST NOT attempt to redirect the RO back to any client instance even
is supplied (Section 2.5.3). if a callback is supplied (Section 2.5.3).
The user code URL MUST be reachable from the RO's browser, though The user code URL MUST be reachable from the RO's browser, though
note that the RO MAY open the URL on a separate device from the RC note that the RO MAY open the URL on a separate device from the
itself. The user code URL MUST be accessible from an HTTP GET client instance itself. The user code URL MUST be accessible from an
request, and MUST be protected by HTTPS or equivalent means. HTTP GET request, and MUST be protected by HTTPS or equivalent means.
While it is common for the RO to be the same party as the RQ, since While it is common for the RO to be the same party as the RQ, since
the RC has to communicate the user code to someone, there are cases the client instance has to communicate the user code to someone,
where the RQ and RO are separate parties and the authorization there are cases where the RQ and RO are separate parties and the
happens asynchronously. authorization 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 client instance successfully launches an application through
mode (Section 3.3.2), the AS interacts with the RO through that the "app" mode (Section 3.3.2), the AS interacts with the RO through
application to authenticate the user as the RO and gather their that 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.
[[ See issue #82 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
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 client instance to continue. If this mode is not available, the
instruct the RO to return to their RC software upon completion. Note AS SHOULD instruct the RO to return to their client instance upon
that these steps still take place in most error cases, such as when completion. Note that these steps still take place in most error
the RO has denied access. This pattern allows the RC to potentially cases, such as when the RO has denied access. This pattern allows
recover from the error state without restarting the request from the client instance to potentially recover from the error state
scratch by modifying its request or providing additional information without restarting the request from scratch by modifying its request
directly to the AS. or providing additional information directly to the AS.
[[ See issue #83 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/83) ]]
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 client instance and
the interaction reference, as described in Section 4.4.3. The RC AS nonces and the interaction reference, as described in
will use this value to validate the return call from the AS. Section 4.4.3. The client instance will use this value to validate
the return call from the AS.
The AS then MUST send the hash and interaction reference based on the The AS then MUST send the hash and interaction reference based on the
interaction finalization mode as described in the following sections. interaction finalization mode as described in the following sections.
4.4.1. Completing Interaction with a Browser Redirect to the Callback 4.4.1. Completing Interaction with a Browser Redirect to the Callback
URI URI
When using the "callback" interaction mode (Section 3.3.3) with the When using the "callback" interaction mode (Section 3.3.3) with the
"redirect" method, the AS signals to the RC that interaction is "redirect" method, the AS signals to the client instance that
complete and the request can be continued by directing the RO (in interaction is complete and the request can be continued by directing
their browser) back to the RC's callback URL sent in the callback the RO (in their browser) back to the client instance's callback URL
request (Section 2.5.3.1). sent in the callback request (Section 2.5.3.1).
The AS secures this callback by adding the hash and interaction The AS secures this callback by adding the hash and interaction
reference as query parameters to the RC's callback URL. reference as query parameters to the client instance's callback URL.
hash REQUIRED. The interaction hash value as described in hash 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 REQUIRED. The interaction reference generated for this
interaction. interaction.
The means of directing the RO to this URL are outside the scope of The means of directing the RO to this URL are outside the scope of
this specification, but common options include redirecting the RO this specification, but common options include redirecting the RO
from a web page and launching the system browser with the target URL. from a web page and launching the system browser with the target URL.
https://client.example.net/return/123455 https://client.example.net/return/123455
?hash=p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A ?hash=p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A
&interact_ref=4IFWWIKYBC2PQ6U56NL1 &interact_ref=4IFWWIKYBC2PQ6U56NL1
When receiving the request, the RC MUST parse the query parameters to When receiving the request, the client instance MUST parse the query
calculate and validate the hash value as described in Section 4.4.3. parameters to calculate and validate the hash value as described in
If the hash validates, the RC sends a continuation request to the AS Section 4.4.3. If the hash validates, the client instance sends a
as described in Section 5.1 using the interaction reference value continuation request to the AS as described in Section 5.1 using the
received here. interaction reference value received here.
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 client instance that interaction
and the request can be continued by sending an HTTP POST request to is complete and the request can be continued by sending an HTTP POST
the RC's callback URL sent in the callback request (Section 2.5.3.2). request to the client instance'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 (string) 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 (string) REQUIRED. The interaction reference generated interact_ref (string) REQUIRED. The interaction reference generated
for this 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"
} }
When receiving the request, the client instance MUST parse the JSON
When receiving the request, the RC MUST parse the JSON object and object and validate the hash value as described in Section 4.4.3. If
validate the hash value as described in Section 4.4.3. If the hash the hash validates, the client instance sends a continuation request
validates, the RC sends a continuation request to the AS as described to the AS as described in Section 5.1 using the interaction reference
in Section 5.1 using the interaction reference value received here. value received here.
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 client instance's callback
front channel response to an ongoing request by using values known URL ties the front channel response to an ongoing request by using
only to the parties involved. This security mechanism allows the RC values known only to the parties involved. This security mechanism
to protect itself against several kinds of session fixation and allows the client instance to protect itself against several kinds of
injection attacks. The AS MUST always provide this hash, and the RC session fixation and injection attacks. The AS MUST always provide
MUST validate the hash when received. this hash, and the client instance MUST validate the hash when
received.
[[ See issue #84 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/84) ]]
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 client instance in the
the initial request (Section 2.5.3), the AS's nonce value from the interaction section of the initial request (Section 2.5.3), the AS's
callback response (Section 3.3.3), and the "interact_ref" sent to the nonce value from the callback response (Section 3.3.3), and the
RC's callback URL. These three values are concatenated to each other "interact_ref" sent to the client instance's callback URL. These
in this order using a single newline character as a separator between three values are concatenated to each other in this order using a
the fields. There is no padding or whitespace before or after any of single newline character as a separator between the fields. There is
the lines, and no trailing newline character. no padding or whitespace before or after any of 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 client instance's request,
defaults to "sha3". the algorithm defaults to "sha3".
[[ See issue #56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #56 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/56) ]] issues/56) ]]
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.
skipping to change at page 58, line 27 skipping to change at page 60, line 15
The "sha2" hash method consists of hashing the input string with the The "sha2" hash method consists of hashing the input string with the
512-bit SHA2 algorithm. The byte array is then encoded using URL 512-bit SHA2 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.
62SbcD3Xs7L40rjgALA-ymQujoh2LB2hPJyX9vlcr1H6ecChZ8BNKkG_HrOKP_Bpj84rh4mC9aE9x7HPBFcIHw 62SbcD3Xs7L40rjgALA-ymQujoh2LB2hPJyX9vlcr1H6ecChZ8BNKkG_HrOKP_Bpj84rh4mC9aE9x7HPBFcIHw
5. Continuing a Grant Request 5. Continuing a Grant Request
While it is possible for the AS to return a Section 3 with all the While it is possible for the AS to return a Section 3 with all the
RC's requested information (including access tokens (Section 3.2) and client instance's requested information (including access tokens
direct user information (Section 3.4)), it's more common that the AS (Section 3.2) and direct user information (Section 3.4)), it's more
and the RC will need to communicate several times over the lifetime common that the AS and the client instance will need to communicate
of an access grant. This is often part of facilitating interaction several times over the lifetime of an access grant. This is often
(Section 4), but it could also be used to allow the AS and RC to part of facilitating interaction (Section 4), but it could also be
continue negotiating the parameters of the original grant request used to allow the AS and client instance to continue negotiating the
(Section 2). parameters of the original grant request (Section 2).
To enable this ongoing negotiation, the AS returns a "continue" field To enable this ongoing negotiation, the AS provides a continuation
in the response (Section 3.1) that contains information the RC needs API to the client software. The AS returns a "continue" field in the
to continue this process with another request, including a URI to response (Section 3.1) that contains information the client instance
access as well as an optional access token to use during the needs to access this API, including a URI to access as well as an
continued requests. access token to use during the continued requests.
When the RC makes any calls to the continuation URL, the RC MUST The access token is initially bound to the same key and method the
present proof of the most recent key associated with this ongoing client instance used to make the initial request. As a consequence,
request by signing the request as described in Section 8. The key in when the client instance makes any calls to the continuation URL, the
use will be either the key from the initial request (Section 2.3.2) client instance MUST present the access token as described in
or its most recent rotation. [[ See issue #85 (https://github.com/ Section 7 and present proof of the client instance's key (or its most
ietf-wg-gnap/gnap-core-protocol/issues/85) ]] recent rotation) by signing the request as described in Section 8.
For example, here the RC makes a POST request and signs with detached [[ See issue #85 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
JWS: issues/85) ]]
POST /continue/80UPRY5NM33OMUKMKSKU HTTP/1.1 For example, here the client instance makes a POST request to a
unique URI and signs the request with detached JWS:
POST /continue/KSKUOMUKM HTTP/1.1
Authorization: GNAP 80UPRY5NM33OMUKMKSKU
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 The AS MUST be able to tell from the client instance's request which
Section 3.1, the RC MUST include the access token the request as specific ongoing request is being accessed, using a combination of
described in Section 7. Note that the access token is always bound the continuation URL, the provided access token, and the client
to the RC's presented key (or its most recent rotation). instance identified by the key signature. If the AS cannot determine
a single active grant request to map the continuation request to, the
AS MUST return an error.
For example, here the RC makes a POST request with the interaction The ability to continue an already-started request allows the client
reference, includes the access token, and signs with detached JWS: instance to perform several important functions, including presenting
additional information from interaction, modifying the initial
request, and getting the current state of the request.
All requests to the continuation API are protected by this bound
access token. For example, here the client instance makes a POST
request to a stable continuation endpoint URL with the interaction
reference (Section 5.1), includes the access token, and signs with
detached JWS:
POST /continue HTTP/1.1 POST /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...
{ {
"interact_ref": "4IFWWIKYBC2PQ6U56NL1" "interact_ref": "4IFWWIKYBC2PQ6U56NL1"
} }
The AS MUST be able to tell from the RC's request which specific
ongoing request is being accessed. Common methods for doing so
include using a unique, unguessable URL for each continuation
response, associating the request with the provided access token, or
allowing only a single ongoing grant request for a given RC instance
at a time. If the AS cannot determine a single active grant request
to map the continuation request to, the AS MUST return an error.
The ability to continue an already-started request allows the RC to
perform several important functions, including presenting additional
information from interaction, modifying the initial request, and
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 client instance MUST NOT call the continuation URI
waiting the number of seconds indicated. If no "wait" period is prior to waiting the number of seconds indicated. If no "wait"
indicated, the RC SHOULD wait at least 5 seconds If the RC does not period is indicated, the client instance SHOULD wait at least 5
respect the given wait period, the AS MUST return an error. [[ See seconds. If the client instance does not respect the given wait
issue #86 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ period, the AS MUST return an error. [[ See issue #86
issues/86) ]] (https://github.com/ietf-wg-gnap/gnap-core-protocol/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 client instance can make a further
request, the AS MUST include a new "continue" response (Section 3.1). continuation request, the AS MUST include a new "continue" response
If the continuation was previously bound to an access token, the new (Section 3.1). The new "continue" response MUST include a bound
"continue" response MUST include a bound access token as well, and access token as well, and this token SHOULD be a new access token,
this token SHOULD be a new access token. If the AS does not return a invalidating the previous access token. If the AS does not return a
new "continue" response, the RC MUST NOT make an additional new "continue" response, the client instance MUST NOT make an
continuation request. If a RC does so, the AS MUST return an error. additional continuation request. If a client instance does so, the
[[ See issue #87 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ AS MUST return an error. [[ See issue #87 (https://github.com/ietf-
issues/87) ]] wg-gnap/gnap-core-protocol/issues/87) ]]
For continuation functions that require the RC to send a message For continuation functions that require the client instance to send a
body, the body MUST be a JSON object. message 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 client instance's "callback" parameter as
Section 4.4.1, this response includes an interaction reference. The in Section 4.4.1, this response includes an interaction reference.
RC MUST include that value as the field "interact_ref" in a POST The client instance MUST include that value as the field
request to the continuation URI. "interact_ref" in a POST request to the continuation URI.
POST /continue/80UPRY5NM33OMUKMKSKU HTTP/1.1 POST /continue HTTP/1.1
Host: server.example.com Host: server.example.com
Content-type: application/json Content-type: application/json
Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
{ {
"interact_ref": "4IFWWIKYBC2PQ6U56NL1" "interact_ref": "4IFWWIKYBC2PQ6U56NL1"
} }
Since the interaction reference is a one-time-use value as described Since the interaction reference is a one-time-use value as described
in Section 4.4.1, if the RC needs to make additional continuation in Section 4.4.1, if the client instance needs to make additional
calls after this request, the RC MUST NOT include the interaction continuation calls after this request, the client instance MUST NOT
reference. If the AS detects an RC submitting the same interaction include the interaction reference. If the AS detects a client
reference multiple times, the AS MUST return an error and SHOULD instance submitting the same interaction reference multiple times,
invalidate the ongoing request. the AS MUST return an error and SHOULD 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). [[ See issue #89 (https://github.com/ietf- responses (Section 3.3). [[ See issue #89 (https://github.com/ietf-
wg-gnap/gnap-core-protocol/issues/89) ]] wg-gnap/gnap-core-protocol/issues/89) ]]
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
skipping to change at page 61, line 19 skipping to change at page 63, line 19
"manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L" "manage": "https://server.example.com/token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L"
}, },
"subject": { "subject": {
"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 client instance can not make an additional
request because a "continue" field is not included. continuation request because a "continue" field is not included.
[[ See issue #88 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #88 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/88) ]] issues/88) ]]
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 client instance does not include a "callback" parameter, the
often need to poll the AS until the RO has authorized the request. client instance will often need to poll the AS until the RO has
To do so, the RC makes a POST request to the continuation URI as in authorized the request. To do so, the client instance makes a POST
Section 5.1, but does not include a message body. request to the continuation URI as in 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
Content-type: application/json Content-type: application/json
Authorization: GNAP 80UPRY5NM33OMUKMKSKU Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
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. If a "continue" field is included, it SHOULD described above. If a "continue" field is included, it SHOULD
include a "wait" field to facilitate a reasonable polling rate by the include a "wait" field to facilitate a reasonable polling rate by the
RC. The response SHOULD NOT contain interaction responses client instance. The response SHOULD NOT contain interaction
(Section 3.3). responses (Section 3.3).
For example, if the request has not yet been authorized by the RO, For example, if the request has not yet been authorized by the RO,
the AS could respond by telling the RC to make another continuation the AS could respond by telling the client instance to make another
request in the future. In this example, a new, unique access token continuation request in the future. In this example, a new, unique
has been issued for the call, which the RC will use in its next access token has been issued for the call, which the client instance
continuation request. will use in its next continuation request.
{ {
"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
} }
skipping to change at page 62, line 42 skipping to change at page 64, line 42
"subject": { "subject": {
"sub_ids": [ { "sub_ids": [ {
"subject_type": "email", "subject_type": "email",
"email": "user@example.com", "email": "user@example.com",
} ] } ]
} }
} }
5.3. Modifying an Existing Request 5.3. Modifying an Existing Request
The RC might need to modify an ongoing request, whether or not tokens The client instance might need to modify an ongoing request, whether
have already been issued or claims have already been released. In or not tokens have already been issued or claims have already been
such cases, the RC makes an HTTP PATCH request to the continuation released. In such cases, the client instance makes an HTTP PATCH
URI and includes any fields it needs to modify. Fields that aren't request to the continuation URI and includes any fields it needs to
included in the request are considered unchanged from the original modify. Fields that aren't included in the request are considered
request. unchanged from the original request.
The RC MAY include the "resources" and "subject" fields as described The client instance MAY include the "resources" and "subject" fields
in Section 2.1 and Section 2.2. Inclusion of these fields override as described in Section 2.1 and Section 2.2. Inclusion of these
any values in the initial request, which MAY trigger additional fields override any values in the initial request, which MAY trigger
requirements and policies by the AS. For example, if the RC is additional requirements and policies by the AS. For example, if the
asking for more access, the AS could require additional interaction client instance is asking for more access, the AS could require
with the RO to gather additional consent. If the RC is asking for additional interaction with the RO to gather additional consent. If
more limited access, the AS could determine that sufficient the client instance is asking for more limited access, the AS could
authorization has been granted to the RC and return the more limited determine that sufficient authorization has been granted to the
access rights immediately. [[ See issue #92 (https://github.com/ client instance and return the more limited access rights
ietf-wg-gnap/gnap-core-protocol/issues/92) ]] immediately. [[ See issue #92 (https://github.com/ietf-wg-gnap/gnap-
core-protocol/issues/92) ]]
The RC MAY include the "interact" field as described in Section 2.5. The client instance MAY include the "interact" field as described in
Inclusion of this field indicates that the RC is capable of driving Section 2.5. Inclusion of this field indicates that the client
interaction with the RO, and this field replaces any values from a instance is capable of driving interaction with the RO, and this
previous request. The AS MAY respond to any of the interaction field replaces any values from a previous request. The AS MAY
responses as described in Section 3.3, just like it would to a new respond to any of the interaction responses as described in
request. Section 3.3, just like it would to a new request.
The RC MAY include the "user" field as described in Section 2.4 to The client instance MAY include the "user" field as described in
present new assertions or information about the RQ. [[ See issue #93 Section 2.4 to present new assertions or information about the RQ.
(https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/93) ]] [[ See issue #93 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/93) ]]
The RC MUST NOT include the "client" section of the request. [[ See The client instance MUST NOT include the "client" section of the
issue #94 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ request. [[ See issue #94 (https://github.com/ietf-wg-gnap/gnap-core-
issues/94) ]] protocol/issues/94) ]]
The RC MAY include post-interaction responses such as described in The client instance MAY include post-interaction responses such as
Section 5.1. [[ See issue #95 (https://github.com/ietf-wg-gnap/gnap- described in Section 5.1. [[ See issue #95 (https://github.com/ietf-
core-protocol/issues/95) ]] wg-gnap/gnap-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. [[ See issue #96 tokens after a modification has occurred. [[ See issue #96
(https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/96) ]] (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/96) ]]
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, a client instance initially requests a set of resources
references: using references:
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": [
"read", "write" "read", "write"
], ],
skipping to change at page 64, line 26 skipping to change at page 66, line 26
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return/123455", "uri": "https://client.example.net/return/123455",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
}, },
"client": "987YHGRT56789IOLK" "client": "987YHGRT56789IOLK"
} }
Access is granted by the RO, and a token is issued by the AS. In its Access is granted by the RO, and a token is issued by the AS. In its
final response, the AS includes a "continue" field: final response, the AS includes a "continue" field, which includes a
separate access token for accessing the continuation API:
{ {
"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": 30 "wait": 30
}, },
"access_token": ... "access_token": {
"value": "RP1LT0-OS9M2P_R64TB",
"key": false,
"resources": [
"read", "write"
]
}
} }
This allows the RC to make an eventual continuation call. The RC This "continue" field allows the client instance to make an eventual
realizes that it no longer needs "write" access and therefore continuation call. In the future, the client instance realizes that
modifies its ongoing request, here asking for just "read" access it no longer needs "write" access and therefore modifies its ongoing
instead of both "read" and "write" as before. request, here asking for just "read" access instead of both "read"
and "write" as before.
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" "read"
] ]
... ...
} }
The AS replaces the previous "resources" from the first request, The AS replaces the previous "resources" from the first request,
allowing the AS to determine if any previously-granted consent allowing the AS to determine if any previously-granted consent
already applies. In this case, the AS would likely determine that already applies. In this case, the AS would likely determine that
reducing the breadth of the requested access means that new access reducing the breadth of the requested access means that new access
tokens can be issued to the RC. The AS would likely revoke tokens can be issued to the client instance. The AS would likely
previously-issued access tokens that had the greater access rights revoke previously-issued access tokens that had the greater access
associated with them. rights associated with them.
{ {
"continue": { "continue": {
"access_token": { "access_token": {
"value": "M33OMUK80UPRY5NMKSKU", "value": "M33OMUK80UPRY5NMKSKU",
"key": true "key": true
}, },
"uri": "https://server.example.com/continue", "uri": "https://server.example.com/continue",
"wait": 30 "wait": 30
}, },
"access_token": ... "access_token": {
"value": "0EVKC7-2ZKwZM_6N760",
"key": false,
"resources": [
"read"
]
}
} }
For another example, the RC initially requests read-only access but For another example, the client instance initially requests read-only
later needs to step up its access. The initial request could look access but later needs to step up its access. The initial request
like this example. could look like this example.
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": [
"read" "read"
], ],
skipping to change at page 66, line 37 skipping to change at page 68, line 37
{ {
"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": 30 "wait": 30
}, },
"access_token": ... "access_token": {
"value": "RP1LT0-OS9M2P_R64TB",
"key": false,
"resources": [
"read"
]
}
} }
This allows the RC to make an eventual continuation call. The RC This allows the client instance to make an eventual continuation
later realizes that it now needs "write" access in addition to the call. The client instance later realizes that it now needs "write"
"read" access. Since this is an expansion of what it asked for access in addition to the "read" access. Since this is an expansion
previously, the RC also includes a new interaction section in case of what it asked for previously, the client instance also includes a
the AS needs to interact with the RO again to gather additional new interaction section in case the AS needs to interact with the RO
authorization. Note that the RC's nonce and callback are different again to gather additional authorization. Note that the client
from the initial request. Since the original callback was already instance's nonce and callback are different from the initial request.
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 Since the original callback was already used in the initial exchange,
again. and the callback is intended for one-time-use, a new one needs to be
included in order to use the callback again.
[[ See issue #97 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #97 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/97) ]] issues/97) ]]
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 67, line 24 skipping to change at page 69, line 32
"interact": { "interact": {
"redirect": true, "redirect": true,
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return/654321", "uri": "https://client.example.net/return/654321",
"nonce": "K82FX4T4LKLTI25DQFZC" "nonce": "K82FX4T4LKLTI25DQFZC"
} }
} }
} }
From here, the AS can determine that the RC is asking for more than From here, the AS can determine that the client instance is asking
it was previously granted, but since the RC has also provided a for more than it was previously granted, but since the client
mechanism to interact with the RO, the AS can use that to gather the instance has also provided a mechanism to interact with the RO, the
additional consent. The protocol continues as it would with a new AS can use that to gather the additional consent. The protocol
request. Since the old access tokens are good for a subset of the continues as it would with a new request. Since the old access
rights requested here, the AS might decide to not revoke them. tokens are good for a subset of the rights requested here, the AS
However, any access tokens granted after this update process are new might decide to not revoke them. However, any access tokens granted
access tokens and do not modify the rights of existing access tokens. after this update process are new access tokens and do not modify the
rights of existing access tokens.
5.4. Getting the Current State of a Grant Request 5.4. Getting the Current State of a Grant Request
If the RC needs to get the current state of an ongoing grant request, If the client instance needs to get the current state of an ongoing
it makes an HTTP GET request to the continuation URI. This request grant request, it makes an HTTP GET request to the continuation URI.
MUST NOT alter the grant request in any fashion, including causing This request MUST NOT alter the grant request in any fashion,
the issuance of new access tokens or modification of interaction including causing the issuance of new access tokens or modification
parameters. of interaction parameters.
The AS MAY include existing access tokens and previously-released The AS MAY include existing access tokens and previously-released
subject claims in the response. The AS MUST NOT issue a new access subject claims in the response. The AS MUST NOT issue a new access
token or release a new subject claim in response to this request. token or release a new subject claim in response to this request.
GET /continue HTTP/1.1 GET /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...
skipping to change at page 68, line 16 skipping to change at page 70, line 22
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.
[[ See issue #98 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #98 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/98) ]] issues/98) ]]
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 client instance wishes to cancel an ongoing grant request, it
DELETE request to the continuation URI. makes an HTTP 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
Detached-JWS: ejy0... Detached-JWS: ejy0...
If the request is successfully cancelled, the AS responds with an If the request is successfully cancelled, the AS responds with an
HTTP 202. The AS MUST revoke all associated access tokens, if HTTP 202. The AS MUST revoke all associated access tokens, if
possible. possible.
6. Token Management 6. Token Management
If an access token response includes the "manage" parameter as If an access token response includes the "manage" parameter as
described in Section 3.2.1, the RC MAY call this URL to manage the described in Section 3.2.1, the client instance MAY call this URL to
access token with any of the actions defined in the following manage the access token with any of the actions defined in the
sections. Other actions are undefined by this specification. following sections. Other actions are undefined by this
specification.
The access token being managed acts as the access element for its own The access token being managed acts as the access element for its own
management API. The RC MUST present proof of an appropriate key management API. The client instance MUST present proof of an
along with the access token. appropriate key along with the access token.
If the token is sender-constrained (i.e., not a bearer token), it If the token is sender-constrained (i.e., not a bearer token), it
MUST be sent with the appropriate binding for the access token MUST be sent with the appropriate binding for the access token
(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 client instance MUST present
key identified in the initial request (Section 2.3.2) as described in proof of the same key identified in the initial request
Section 8. (Section 2.3.2) as described in 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 client instance the token was issued
appropriate for the token's presentation type. to, as appropriate for the token's presentation type.
[[ See issue #99 (https://github.com/ietf-wg-gnap/gnap-core-protocol/ [[ See issue #99 (https://github.com/ietf-wg-gnap/gnap-core-protocol/
issues/99) ]] issues/99) ]]
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 client instance makes an HTTP POST to the token management URI,
access token in the appropriate header and signing the request with sending the access token in the appropriate header and signing the
the appropriate key. request with 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....
[[ See issue #100 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/100) ]]
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 client
that the presented key is appropriate to the token. instance, and 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
attempting to refresh the expired token. To support this, the AS MAY client instance is attempting to refresh the expired token. To
apply different lifetimes for the use of the token in management vs. support this, the AS MAY apply different lifetimes for the use of the
its use at an RS. An AS MUST NOT honor a rotation request for an token in management vs. its use at an RS. An AS MUST NOT honor a
access token that has been revoked, either by the AS or by the RC rotation request for an access token that has been revoked, either by
through the token management URI (Section 6.2). the AS or by the client instance 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. The value of the access token MUST NOT be the same as the request. The value of the access token MUST NOT be the same as the
current value of the access token used to access the management API. current value of the access token used to access the management API.
The response MAY include an updated access token management URL as The response MAY include an updated access token management URL as
well, and if so, the RC MUST use this new URL to manage the new well, and if so, the client instance MUST use this new URL to manage
access token. [[ See issue #101 (https://github.com/ietf-wg-gnap/ the new access token. [[ See issue #101 (https://github.com/ietf-wg-
gnap-core-protocol/issues/101) ]] gnap/gnap-core-protocol/issues/101) ]]
[[ See issue #102 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #102 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/102) ]] protocol/issues/102) ]]
{ {
"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": [
skipping to change at page 70, line 37 skipping to change at page 72, line 37
"read", "dolphin-metadata" "read", "dolphin-metadata"
] ]
} }
} }
[[ See issue #103 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #103 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/103) ]] protocol/issues/103) ]]
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 client instance wishes to revoke the access token proactively,
a user indicates to the RC that they no longer wish for it to have such as when a user indicates to the client instance that they no
access or the RC application detects that it is being uninstalled, longer wish for it to have access or the client instance application
the RC can use the token management URI to indicate to the AS that detects that it is being uninstalled, the client instance can use the
the AS should invalidate the access token for all purposes. token management URI to indicate to the AS that the AS should
invalidate the access token for all purposes.
The RC makes an HTTP DELETE request to the token management URI, The client instance makes an HTTP DELETE request to the token
presenting the access token and signing the request with the management URI, presenting the access token and signing the request
appropriate key. with the appropriate key.
DELETE /token/PRY5NM33OM4TB8N6BW7OZB8CDFONP219RP1L HTTP/1.1 DELETE /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....
If the key presented is associated with the token (or the RC, in the If the key presented is associated with the token (or the client
case of a bearer token), the AS MUST invalidate the access token, if instance, in the case of a bearer token), the AS MUST invalidate the
possible, and return an HTTP 204 response code. access token, if possible, and return an HTTP 204 response code.
204 No Content 204 No Content
Though the AS MAY revoke an access token at any time for any reason, Though the AS MAY revoke an access token at any time for any reason,
the token management function is specifically for the RC's use. If the token management function is specifically for the client
the access token has already expired or has been revoked through instance's use. If the access token has already expired or has been
other means, the AS SHOULD honor the revocation request to the token revoked through other means, the AS SHOULD honor the revocation
management URL as valid, since the end result is still the token not request to the token management URL as valid, since the end result is
being usable. still the token not being usable.
7. Using Access Tokens 7. Using Access Tokens
The method the RC uses to send an access token to the RS depends on The method the client instance uses to send an access token to the RS
the value of the "key" and "proof" parameters in the access token depends on the value of the "key" and "proof" parameters in the
response (Section 3.2.1). access token response (Section 3.2.1).
If the key value is the boolean "false", the access token is a bearer If the key value is the boolean "false", the access token is a bearer
token sent using the HTTP Header method defined in [RFC6750]. token sent using the HTTP Header method defined in [RFC6750].
Authorization: Bearer OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0 Authorization: Bearer OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0
The form parameter and query parameter methods of [RFC6750] MUST NOT The form parameter and query parameter methods of [RFC6750] MUST NOT
be used. be used.
If the "key" value is the boolean "true", the access token MUST be If the "key" value is the boolean "true", the access token MUST be
sent to the RS using the same key and proofing mechanism that the RC sent to the RS using the same key and proofing mechanism that the
used in its initial request. client instance used in its initial request.
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....
[[ See issue #104 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #104 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/104) ]] protocol/issues/104) ]]
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 client instance to the AS or RS MUST be
part of the request in which they are presented. The type of binding validated as part of the request in which they are presented. The
used is indicated by the proof parameter of the key section in the type of binding used is indicated by the proof parameter of the key
initial request Section 2.3.2. Values defined by this specification section in the initial request Section 2.3.2. Values defined by this
are as follows: specification are as follows:
jwsd A detached JWS signature header jwsd A detached JWS signature header
jws Attached JWS payload jws Attached JWS payload
mtls Mutual TLS certificate verification mtls Mutual TLS certificate verification
dpop OAuth Demonstration of Proof-of-Possession key proof header dpop OAuth Demonstration of Proof-of-Possession key proof header
httpsig HTTP Signing signature header httpsig HTTP Signing signature header
skipping to change at page 72, line 39 skipping to change at page 74, line 39
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 for delegation in GNAP, these key binding mechanisms allow When used for delegation in GNAP, these key binding mechanisms allow
the AS to ensure that the keys presented by the RC in the initial the AS to ensure that the keys presented by the client instance in
request are in control of the party calling any follow-up or the initial request are in control of the party calling any follow-up
continuation requests. To facilitate this requirement, all keys in or continuation requests. To facilitate this requirement, the
the initial request Section 2.3.2 MUST be proved in all continuation continuation response (Section 3.1) includes an access token bound to
requests Section 5 and token management requests Section 6, modulo the client instance's key (Section 2.3.2), and that key (or its most
any rotations on those keys over time that the AS knows about. The recent rotation) MUST be proved in all continuation requests
AS MUST validate all keys presented by the RC (Section 2.3.2) or Section 5. Token management requests Section 6 are similarly bound
referenced in an ongoing request for each call within that request. to either the access token's own key or, in the case of bearer
tokens, the client instance's key. The AS MUST validate all keys
presented by the client instance (Section 2.3.2) or referenced in an
ongoing request for each call within that request.
[[ See issue #105 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #105 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/105) ]] protocol/issues/105) ]]
When used to bind to an access token, the access token MUST be When used to bind to an access token, the access token MUST be
covered by the signature method. 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 client instance for this request. The JWS header MUST
field appropriate for the key identified by kid and MUST NOT be contain an "alg" field appropriate for the key identified by kid and
"none". The "b64" field MUST be set to "false" and the "crit" field MUST NOT be "none". The "b64" field MUST be set to "false" and the
MUST contain at least "b64" as specified in [RFC7797] "crit" field 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 (string) The HTTP Method used to make this request, as an htm (string) The HTTP Method used to make this request, as an
uppercase ASCII string. uppercase ASCII string.
htu (string) The HTTP URI used for this request, including all path htu (string) The HTTP URI used for this request, including all path
and query components. and query components.
skipping to change at page 73, line 42 skipping to change at page 75, line 44
parameter of the JWS's JOSE Header. For instance, if the "alg" is parameter of the JWS's JOSE Header. For instance, if the "alg" is
"RS256", hash the "access_token" value with SHA-256, then take the "RS256", hash the "access_token" value with SHA-256, then take the
left-most 128 bits and base64url encode them. left-most 128 bits and base64url encode them.
[[ See issue #106 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #106 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/106) ]] protocol/issues/106) ]]
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 client instance presents the signature in the Detached-JWS HTTP
[[ See issue #107 (https://github.com/ietf-wg-gnap/gnap-core- Header field.
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 75, line 13 skipping to change at page 77, 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.
[[ See issue #108 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/108) ]]
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 client instance for this request. The JWS header MUST
field appropriate for the key identified by kid and MUST NOT be contain an "alg" field appropriate for the key identified by kid and
"none". MUST NOT be "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 (string) The HTTP Method used to make this request, as an htm (string) The HTTP Method used to make this request, as an
uppercase ASCII string. uppercase ASCII string.
htu (string) The HTTP URI used for this request, including all path htu (string) The HTTP URI used for this request, including all path
and query components. and query components.
skipping to change at page 75, line 46 skipping to change at page 77, line 43
at_hash (string) When to bind a request to an access token, the at_hash (string) When to bind a request to an access token, the
access token hash value. Its value is the base64url encoding of access token hash value. Its value is the base64url encoding of
the left-most half of the hash of the octets of the ASCII the left-most half of the hash of the octets of the ASCII
representation of the "access_token" value, where the hash representation of the "access_token" value, where the hash
algorithm used is the hash algorithm used in the "alg" header algorithm used is the hash algorithm used in the "alg" header
parameter of the JWS's JOSE Header. For instance, if the "alg" is parameter of the JWS's JOSE Header. For instance, if the "alg" is
"RS256", hash the "access_token" value with SHA-256, then take the "RS256", hash the "access_token" value with SHA-256, then take the
left-most 128 bits and base64url encode them. left-most 128 bits and base64url encode them.
[[ See issue #107 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/107) ]]
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 client instance presents the JWS as the body of the request along
content type of "application/jose". The AS MUST extract the payload with a content type of "application/jose". The AS MUST extract the
of the JWS and treat it as the request body for further processing. payload of the JWS and treat it as the request body for further
processing.
POST /tx HTTP/1.1 POST /tx HTTP/1.1
Host: server.example.com Host: server.example.com
Content-Type: application/jose Content-Type: application/jose
eyJhbGciOiJSUzI1NiIsImtpZCI6IktBZ05wV2JSeXk5T eyJhbGciOiJSUzI1NiIsImtpZCI6IktBZ05wV2JSeXk5T
WYycmlrbDQ5OExUaE1ydmtiWldIVlNRT0JDNFZIVTQiLC WYycmlrbDQ5OExUaE1ydmtiWldIVlNRT0JDNFZIVTQiLC
JodG0iOiJwb3N0IiwiaHR1IjoiL3R4IiwidHMiOjE2MDM JodG0iOiJwb3N0IiwiaHR1IjoiL3R4IiwidHMiOjE2MDM
4MDA3ODN9.eyJjYXBhYmlsaXRpZXMiOltdLCJjbGllbnQ 4MDA3ODN9.eyJjYXBhYmlsaXRpZXMiOltdLCJjbGllbnQ
iOnsia2V5Ijp7Imp3ayI6eyJrdHkiOiJSU0EiLCJlIjoi iOnsia2V5Ijp7Imp3ayI6eyJrdHkiOiJSU0EiLCJlIjoi
skipping to change at page 79, line 14 skipping to change at page 81, line 14
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.
[[ See issue #109 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #109 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/109) ]] protocol/issues/109) ]]
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 client
presents its client certificate during TLS negotiation with the instance presents its TLS client certificate during TLS negotiation
server (either AS or RS). The AS or RS takes the thumbprint of the with the server (either AS or RS). The AS or RS takes the thumbprint
client certificate presented during mutual TLS negotiation and of the TLS client certificate presented during mutual TLS negotiation
compares that thumbprint to the thumbprint presented by the RC and compares that thumbprint to the thumbprint presented by the
application as described in [RFC8705] section 3. client instance application as described in [RFC8705] section 3.
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
SSL_CLIENT_CERT: MIIEHDCCAwSgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBmjE3MDUGA1UEAwwuQmVz SSL_CLIENT_CERT: MIIEHDCCAwSgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBmjE3MDUGA1UEAwwuQmVz
cG9rZSBFbmdpbmVlcmluZyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eTELMAkG cG9rZSBFbmdpbmVlcmluZyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eTELMAkG
A1UECAwCTUExCzAJBgNVBAYTAlVTMRkwFwYJKoZIhvcNAQkBFgpjYUBic3BrLmlv A1UECAwCTUExCzAJBgNVBAYTAlVTMRkwFwYJKoZIhvcNAQkBFgpjYUBic3BrLmlv
MRwwGgYDVQQKDBNCZXNwb2tlIEVuZ2luZWVyaW5nMQwwCgYDVQQLDANNVEkwHhcN MRwwGgYDVQQKDBNCZXNwb2tlIEVuZ2luZWVyaW5nMQwwCgYDVQQLDANNVEkwHhcN
MTkwNDEwMjE0MDI5WhcNMjQwNDA4MjE0MDI5WjB8MRIwEAYDVQQDDAlsb2NhbGhv MTkwNDEwMjE0MDI5WhcNMjQwNDA4MjE0MDI5WjB8MRIwEAYDVQQDDAlsb2NhbGhv
c3QxCzAJBgNVBAgMAk1BMQswCQYDVQQGEwJVUzEgMB4GCSqGSIb3DQEJARYRdGxz c3QxCzAJBgNVBAgMAk1BMQswCQYDVQQGEwJVUzEgMB4GCSqGSIb3DQEJARYRdGxz
skipping to change at page 81, line 7 skipping to change at page 83, line 7
/p6BW/LV1NCgYB1QtFSfGxowqb9FRIMD2kvMSmO0EMxgwZ6k6spa+jk0IsI3klwLW /p6BW/LV1NCgYB1QtFSfGxowqb9FRIMD2kvMSmO0EMxgwZ6k6spa+jk0IsI3klwLW
9b+Tfn/daUbIDctxeJneq2anQyU2znBgQl6KILDSF4eaOqlBut/KNZHHazJh" 9b+Tfn/daUbIDctxeJneq2anQyU2znBgQl6KILDSF4eaOqlBut/KNZHHazJh"
} }
} }
[[ See issue #110 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #110 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/110) ]] protocol/issues/110) ]]
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 client
creates a Demonstration of Proof-of-Possession signature header as instance creates a Demonstration of Proof-of-Possession signature
described in [I-D.ietf-oauth-dpop] section 2. In addition to the header as described in [I-D.ietf-oauth-dpop] section 2. In addition
required fields, the DPoP body MUST also contain a digest of the to the required fields, the DPoP body MUST also contain a digest of
request body: the request body:
digest (string) Digest of the request body as the value of the digest (string) Digest of the request body as the value of the
Digest header 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
skipping to change at page 82, line 24 skipping to change at page 84, 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"
} }
} }
} }
} }
[[ See issue #111 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/111) ]]
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
creates an HTTP Signature header as described in client instance 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 client instance
calculate and present the Digest header as defined in [RFC3230] and MUST calculate and present the Digest header as defined in [RFC3230]
include this header in the signature. and include this header in the signature.
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
Content-Length: 716 Content-Length: 716
Signature: keyId="xyz-client", algorithm="rsa-sha256", Signature: keyId="xyz-client", algorithm="rsa-sha256",
headers="(request-target) digest content-length", headers="(request-target) digest content-length",
signature="TkehmgK7GD/z4jGkmcHS67cjVRgm3zVQNlNrrXW32Wv7d signature="TkehmgK7GD/z4jGkmcHS67cjVRgm3zVQNlNrrXW32Wv7d
u0VNEIVI/dMhe0WlHC93NP3ms91i2WOW5r5B6qow6TNx/82/6W84p5jqF u0VNEIVI/dMhe0WlHC93NP3ms91i2WOW5r5B6qow6TNx/82/6W84p5jqF
YuYfTkKYZ69GbfqXkYV9gaT++dl5kvZQjVk+KZT1dzpAzv8hdk9nO87Xi YuYfTkKYZ69GbfqXkYV9gaT++dl5kvZQjVk+KZT1dzpAzv8hdk9nO87Xi
skipping to change at page 83, line 43 skipping to change at page 85, line 39
} }
} }
} }
} }
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
creates an HTTP Authorization PoP header as described in client instance creates an HTTP Authorization PoP header as described
[I-D.ietf-oauth-signed-http-request] section 4, with the following in [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 * The "at" (access token) field MUST be omitted unless this method
is 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.
[[ See issue #112 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #112 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/112) ]] 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).
skipping to change at page 85, line 32 skipping to change at page 87, line 28
} }
} }
} }
[[ See issue #113 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #113 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/113) ]] protocol/issues/113) ]]
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 client instance only needs to
endpoint of the AS and which keys it will use to sign the request. know the endpoint of the AS and which keys it will use to sign the
Everything else can be negotiated dynamically in the course of the request. Everything else can be negotiated dynamically in the course
protocol. of the 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 client instance wants to optimize its calls to the AS before making a
MAY send an HTTP OPTIONS request to the grant request endpoint to request, it MAY send an HTTP OPTIONS request to the grant request
retrieve the server's discovery information. The AS MUST respond endpoint to retrieve the server's discovery information. The AS MUST
with a JSON document containing the following information: respond with a JSON document containing the following information:
grant_request_endpoint (string) REQUIRED. The full URL of the AS's grant_request_endpoint (string) REQUIRED. The full URL of the AS's
grant request endpoint. This MUST match the URL the RC used to grant request endpoint. This MUST match the URL the client
make the discovery request. instance used to make the discovery request.
capabilities (array of strings) OPTIONAL. A list of the AS's capabilities (array of strings) OPTIONAL. A list of the AS's
capabilities. The values of this result MAY be used by the RC in capabilities. The values of this result MAY be used by the client
the capabilities section (Section 2.6) of the request. instance in the capabilities section (Section 2.6) of the request.
interaction_methods (array of strings) OPTIONAL. A list of the AS's interaction_methods (array of strings) OPTIONAL. A list of the AS's
interaction methods. The values of this list correspond to the interaction methods. The values of this list correspond to the
possible fields in the interaction section (Section 2.5) of the possible fields in the interaction section (Section 2.5) of the
request. request.
key_proofs (array strings) OPTIONAL. A list of the AS's supported key_proofs (array strings) OPTIONAL. A list of the AS's supported
key proofing mechanisms. The values of this list correspond to key proofing mechanisms. The values of this list correspond to
possible values of the "proof" field of the key section possible values of the "proof" field of the key section
(Section 2.3.2) of the request. (Section 2.3.2) of the request.
skipping to change at page 86, line 26 skipping to change at page 88, line 23
request. request.
assertions (array of strings) OPTIONAL. A list of the AS's assertions (array of strings) OPTIONAL. A list of the AS's
supported assertion formats. The values of this list correspond supported assertion formats. The values of this list correspond
to possible values of the subject assertion section (Section 2.2) to possible values of the subject assertion section (Section 2.2)
of the request. 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 client instance can be registered with the "mtls" key proofing
but the AS also returns other proofing methods, then the AS will deny mechanism, but the AS also returns other proofing methods, then the
a request from that RC using a different proofing mechanism. AS will deny a request from that client instance 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.
[[ See issue #114 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #114 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/114) ]] protocol/issues/114) ]]
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. [[ See issue #115 endpoint at the AS to get token information. [[ See issue #115
(https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/115) ]] (https://github.com/ietf-wg-gnap/gnap-core-protocol/issues/115) ]]
+------+ +------+ +------+ +--------+ +------+ +------+
| RC |--(1)->| RS | | AS | | Client |--(1)->| RS | | AS |
| | | |--(2)->| | |Instance| | |--(2)->| |
| | | |<-(3)--| | | | | |<-(3)--| |
| | | | +------+ | | | | +------+
| |<-(4)--| | | |<-(4)--| |
+------+ +------+ +--------+ +------+
1. The RC calls the RS with its access token.
1. The client instance 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 client instance's key
token's key). or the 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 client instance's
the introspection response for the token. request and returns the introspection response for the token.
4. The RS fulfills the request from the RC. 4. The RS fulfills the request from the client instance.
The RS signs the request with its own key and sends the access token The RS signs the request with its own key and sends the access token
as the body of the request. as the body of the request.
POST /introspect HTTP/1.1 POST /introspect 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...
{ {
skipping to change at page 88, line 7 skipping to change at page 90, line 7
"kid": "xyz-1", "kid": "xyz-1",
"alg": "RS256", "alg": "RS256",
"n": "kOB5rR4Jv0GMeL...." "n": "kOB5rR4Jv0GMeL...."
} }
} }
} }
} }
10.2. Deriving a downstream token 10.2. Deriving a downstream token
Some architectures require an RS to act as an RC and request a Some architectures require an RS to act as a client instance and
derived access token for a secondary RS. This internal token is request a derived access token for a secondary RS. This internal
issued in the context of the incoming access token. token is issued in the context of the incoming access token.
+------+ +-------+ +------+ +-------+ +--------+ +-------+ +------+ +-------+
| RC |--(1)->| RS1 | | AS | | RS2 | | Client |--(1)->| RS1 | | AS | | RS2 |
| | | |--(2)->| | | | |Instance| | |--(2)->| | | |
| | | |<-(3)--| | | | | | | |<-(3)--| | | |
| | | | +------+ | | | | | | +------+ | |
| | | | | | | | | | | |
| | | |-----------(4)------->| | | | | |-----------(4)------->| |
| | | |<----------(5)--------| | | | | |<----------(5)--------| |
| |<-(6)--| | | | | |<-(6)--| | | |
+------+ +-------+ +-------+ +--------+ +-------+ +-------+
1. The RC calls RS1 with an access token. 1. The client instance calls RS1 with an access token.
2. RS1 presents that token to the AS to get a derived token for use 2. RS1 presents that token to the AS to get a derived token for use
at RS2. RS1 indicates that it has no ability to interact with at RS2. RS1 indicates that it has no ability to interact with
the RO. RS1 signs its request with its own key, not the token's the RO. RS1 signs its request with its own key, not the token's
key or the RC's key. key or the client instance's key.
3. The AS returns a derived token to RS1 for use at RS2. 3. The AS returns a derived token to RS1 for use at RS2.
4. RS1 calls RS2 with the token from (3). 4. RS1 calls RS2 with the token from (3).
5. RS2 fulfills the call from RS1. 5. RS2 fulfills the call from RS1.
6. RS1 fulfills the call from RC. 6. RS1 fulfills the call from client instance.
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.
[[ See issue #116 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #116 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/116) ]] protocol/issues/116) ]]
skipping to change at page 91, line 7 skipping to change at page 93, line 7
} }
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.
[[ See issue #117 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #117 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/117) ]] protocol/issues/117) ]]
10.4. Requesting 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 client instance calls an RS without an access token, or with
access token, the RS MAY respond to the RC with an authentication an invalid access token, the RS MAY respond to the client instance
header indicating that GNAP needs to be used to access the resource. with an authentication header indicating that GNAP needs to be used
The address of the GNAP endpoint MUST be sent in the "as_uri" to access the resource. The address of the GNAP endpoint MUST be
parameter. The RS MAY additionally return a resource reference that sent in the "as_uri" parameter. The RS MAY additionally return a
the RC MAY use in its resource request (Section 2.1). This resource resource reference that the client instance MAY use in its resource
reference handle SHOULD be sufficient for at least the action the RC request (Section 2.1). This resource reference handle SHOULD be
was attempting to take at the RS. The RS MAY use the dynamic sufficient for at least the action the client instance was attempting
resource handle request (Section 10.3) to register a new resource to take at the RS. The RS MAY use the dynamic resource handle
handle, or use a handle that has been pre-configured to represent request (Section 10.3) to register a new resource handle, or use a
what the AS is protecting. The content of this handle is opaque to handle that has been pre-configured to represent what the AS is
the RS and the RC. protecting. The content of this handle is opaque to the RS and the
client instance.
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 client instance then makes a call to the "as_uri" as described in
with the value of "resource" as one of the members of a "resources" Section 2, with the value of "resource" as one of the members of a
array Section 2.1.1. The RC MAY request additional resources and "resources" array Section 2.1.1. The client instance MAY request
other information, and MAY request multiple access tokens. additional resources and other information, and MAY request multiple
access tokens.
[[ See issue #118 (https://github.com/ietf-wg-gnap/gnap-core- [[ See issue #118 (https://github.com/ietf-wg-gnap/gnap-core-
protocol/issues/118) ]] protocol/issues/118) ]]
11. Acknowledgements 11. Acknowledgements
The author would like to thank the feedback of the following The editors 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, Justin
Moriarty, Mike Jones, Mike Varley, Nat Sakimura, Takahiko Kawasaki, Richer, Kathleen Moriarty, Mike Jones, Mike Varley, Nat Sakimura,
Takahiro Tsuchiya. Takahiko Kawasaki, Takahiro Tsuchiya.
In particular, the author would like to thank Aaron Parecki and Mike The editors would also like to thank the GNAP working group design
team of Kathleen Moriarty, Fabien Imbault, Dick Hardt, Mike Jones,
and Justin Richer, who incorporated elements from the XAuth and XYZ
proposals to create the first version of this document.
In addition, the editors would like to thank Aaron Parecki and Mike
Jones for insights into how to integrate identity and authentication Jones for insights into how to integrate identity and authentication
systems into the core protocol, and to Dick Hardt for the use cases, systems into the core protocol, and Justin Richer and Dick Hardt for
diagrams, and insights provided in the XAuth proposal that have been the use cases, diagrams, and insights provided in the XYZ and XAuth
incorporated here. The author would like to especially thank Mike proposals that have been incorporated here. The editors would like
Varley and the team at SecureKey for feedback and development of to especially thank Mike Varley and the team at SecureKey for
early versions of the XYZ protocol that fed into this standards work. feedback and development of early versions of the XYZ protocol that
fed into this standards work.
12. IANA Considerations 12. IANA Considerations
[[ TBD: There are a lot of items in the document that are expandable [[ TBD: There are a lot of items in the document that are expandable
through the use of value registries. ]] through the use of value registries. ]]
13. Security Considerations 13. Security Considerations
[[ TBD: There are a lot of security considerations to add. ]] [[ TBD: There are a lot of security considerations to add. ]]
skipping to change at page 92, line 20 skipping to change at page 94, line 34
handles act as shared secrets, though they can be combined with a handles act as shared secrets, though they can be combined with a
requirement to provide proof of a key as well. requirement to provide proof of a key as well.
14. Privacy Considerations 14. Privacy Considerations
[[ TBD: There are a lot of privacy considerations to add. ]] [[ TBD: There are a lot of privacy considerations to add. ]]
Handles are passed between parties and therefore should not contain Handles are passed between parties and therefore should not contain
any private data. any private data.
When user information is passed to the RC, the AS needs to make sure When user information is passed to the client instance, the AS needs
that it has the permission to do so. to make sure that it has the permission to do so.
15. Normative References 15. Normative References
[BCP195] Sheffer, Y., Holz, R., and P. Saint-Andre, [BCP195] Sheffer, Y., Holz, R., and P. Saint-Andre,
"Recommendations for Secure Use of Transport Layer "Recommendations for Secure Use of Transport Layer
Security (TLS) and Datagram Transport Layer Security Security (TLS) and Datagram Transport Layer Security
(DTLS)", May 2015, (DTLS)", May 2015,
<http://www.rfc-editor.org/info/bcp195>. <http://www.rfc-editor.org/info/bcp195>.
[I-D.ietf-httpbis-message-signatures] [I-D.ietf-httpbis-message-signatures]
Backman, A., Richer, J., and M. Sporny, "Signing HTTP Backman, A., Richer, J., and M. Sporny, "Signing HTTP
Messages", Work in Progress, Internet-Draft, draft-ietf- Messages", Work in Progress, Internet-Draft, draft-ietf-
httpbis-message-signatures-00, 10 April 2020, httpbis-message-signatures-01, 17 November 2020,
<http://www.ietf.org/internet-drafts/draft-ietf-httpbis- <http://www.ietf.org/internet-drafts/draft-ietf-httpbis-
message-signatures-00.txt>. message-signatures-01.txt>.
[I-D.ietf-oauth-dpop] [I-D.ietf-oauth-dpop]
Fett, D., Campbell, B., Bradley, J., Lodderstedt, T., Fett, D., Campbell, B., Bradley, J., Lodderstedt, T.,
Jones, M., and D. Waite, "OAuth 2.0 Demonstration of Jones, M., and D. Waite, "OAuth 2.0 Demonstrating Proof-
Proof-of-Possession at the Application Layer (DPoP)", Work of-Possession at the Application Layer (DPoP)", Work in
in Progress, Internet-Draft, draft-ietf-oauth-dpop-01, 1 Progress, Internet-Draft, draft-ietf-oauth-dpop-02, 18
May 2020, <http://www.ietf.org/internet-drafts/draft-ietf- November 2020, <http://www.ietf.org/internet-drafts/draft-
oauth-dpop-01.txt>. ietf-oauth-dpop-02.txt>.
[I-D.ietf-oauth-signed-http-request] [I-D.ietf-oauth-signed-http-request]
Richer, J., Bradley, J., and H. Tschofenig, "A Method for Richer, J., Bradley, J., and H. Tschofenig, "A Method for
Signing HTTP Requests for OAuth", Work in Progress, Signing HTTP Requests for OAuth", Work in Progress,
Internet-Draft, draft-ietf-oauth-signed-http-request-03, 8 Internet-Draft, draft-ietf-oauth-signed-http-request-03, 8
August 2016, <http://www.ietf.org/internet-drafts/draft- August 2016, <http://www.ietf.org/internet-drafts/draft-
ietf-oauth-signed-http-request-03.txt>. ietf-oauth-signed-http-request-03.txt>.
[I-D.ietf-secevent-subject-identifiers] [I-D.ietf-secevent-subject-identifiers]
Backman, A. and M. Scurtescu, "Subject Identifiers for Backman, A. and M. Scurtescu, "Subject Identifiers for
Security Event Tokens", Work in Progress, Internet-Draft, Security Event Tokens", Work in Progress, Internet-Draft,
draft-ietf-secevent-subject-identifiers-06, 4 September draft-ietf-secevent-subject-identifiers-06, 4 September
2020, <http://www.ietf.org/internet-drafts/draft-ietf- 2020, <http://www.ietf.org/internet-drafts/draft-ietf-
secevent-subject-identifiers-06.txt>. secevent-subject-identifiers-06.txt>.
[OIDC] Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and [OIDC] Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and
C. Mortimore, "OpenID Connect Core 1.0 incorporating C. Mortimore, "OpenID Connect Core 1.0 incorporating
errata set 1", November 2014, errata set 1", November 2014,
<https://openiD.net/specs/openiD-connect-core-1_0.html>. <https://openiD.net/specs/openiD-connect-core-1_0.html>.
[OIDC4IA] Lodderstedt, T. and D. Fett, "OpenID Connect for Identity
Assurance 1.0", October 2019, <https://openid.net/specs/
openid-connect-4-identity-assurance-1_0.html>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC3230] Mogul, J. and A. Van Hoff, "Instance Digests in HTTP", [RFC3230] Mogul, J. and A. Van Hoff, "Instance Digests in HTTP",
RFC 3230, DOI 10.17487/RFC3230, January 2002, RFC 3230, DOI 10.17487/RFC3230, January 2002,
<https://www.rfc-editor.org/info/rfc3230>. <https://www.rfc-editor.org/info/rfc3230>.
[RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying
skipping to change at page 94, line 27 skipping to change at page 96, line 35
<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
* -03
- Changed "resource client" terminology to separate "client
instance" and "client software".
* -02 * -02
- Moved all "editor's note" items to GitHub Issues. - Moved all "editor's note" items to GitHub Issues.
* -01 - Added JSON types to fields.
- Changed "GNAP Protocol" to "GNAP".
- Editorial fixes.
* -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
- Initial working group draft. - Initial working group draft.
skipping to change at page 95, line 26 skipping to change at page 97, line 44
features that can be combined to solve many different kinds of features that can be combined to solve many different kinds of
authentication scenarios. This section seeks to show examples of how authentication scenarios. This section seeks to show examples of how
the protocol would be applied for different situations. the protocol would be applied for different situations.
Some longer fields, particularly cryptographic information, have been Some longer fields, particularly cryptographic information, have been
truncated for display purposes in these examples. truncated for display purposes in these examples.
C.1. Redirect-Based User Interaction C.1. Redirect-Based User Interaction
In this scenario, the user is the RO and has access to a web browser, In this scenario, the user is the RO and has access to a web browser,
and the client can take front-channel callbacks on the same device as and the client instance can take front-channel callbacks on the same
the user. This combination is analogous to the OAuth 2 Authorization device as the user. This combination is analogous to the OAuth 2
Code grant type. Authorization Code grant type.
The client initiates the request to the AS. Here the client The client instance initiates the request to the AS. Here the client
identifies itself using its public key. instance identifies itself using its public key.
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 97, line 6 skipping to change at page 99, line 6
"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"
} }
} }
} }
The AS processes the request and determines that the RO needs to The AS processes the request and determines that the RO needs to
interact. The AS returns the following response giving the client interact. The AS returns the following response giving the client
the information it needs to connect. The AS has also indicated to instance the information it needs to connect. The AS has also
the client that it can use the given instance identifier to identify indicated to the client instance that it can use the given instance
itself in future requests (Section 2.3.1). identifier to identify itself in future requests (Section 2.3.1).
Content-type: application/json Content-type: application/json
{ {
"interact": { "interact": {
"redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ", "redirect": "https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ",
"callback": "MBDOFXG4Y5CVJCX821LH" "callback": "MBDOFXG4Y5CVJCX821LH"
} }
"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"
}, },
"instance_id": "7C7C4AZ9KHRS6X63AJAO" "instance_id": "7C7C4AZ9KHRS6X63AJAO"
} }
The client saves the response and redirects the user to the The client instance saves the response and redirects the user to the
interaction_url by sending the following HTTP message to the user's interaction_url by sending the following HTTP message to the user's
browser. browser.
HTTP 302 Found HTTP 302 Found
Location: https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ Location: https://server.example.com/interact/4CF492MLVMSW9MKMXKHQ
The user's browser fetches the AS's interaction URL. The user logs The user's browser fetches the AS's interaction URL. The user logs
in, is identified as the RO for the resource being requested, and in, is identified as the RO for the resource being requested, and
approves the request. Since the AS has a callback parameter, the AS approves the request. Since the AS has a callback parameter, the AS
generates the interaction reference, calculates the hash, and generates the interaction reference, calculates the hash, and
redirects the user back to the client with these additional values redirects the user back to the client instance with these additional
added as query parameters. values added as query parameters.
HTTP 302 Found HTTP 302 Found
Location: https://client.example.net/return/123455 Location: https://client.example.net/return/123455
?hash=p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A ?hash=p28jsq0Y2KK3WS__a42tavNC64ldGTBroywsWxT4md_jZQ1R2HZT8BOWYHcLmObM7XHPAdJzTZMtKBsaraJ64A
&interact_ref=4IFWWIKYBC2PQ6U56NL1 &interact_ref=4IFWWIKYBC2PQ6U56NL1
The client receives this request from the user's browser. The client The client instance receives this request from the user's browser.
ensures that this is the same user that was sent out by validating The client instance ensures that this is the same user that was sent
session information and retrieves the stored pending request. The out by validating session information and retrieves the stored
client uses the values in this to validate the hash parameter. The pending request. The client instance uses the values in this to
client then calls the continuation URL and presents the handle and validate the hash parameter. The client instance then calls the
interaction reference in the request body. The client signs the continuation URL and presents the handle and interaction reference in
request as above. the request body. The client instance signs the request as above.
POST /continue HTTP/1.1 POST /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...
{ {
"interact_ref": "4IFWWIKYBC2PQ6U56NL1" "interact_ref": "4IFWWIKYBC2PQ6U56NL1"
} }
The AS retrieves the pending request based on the handle and issues a The AS retrieves the pending request based on the handle and issues a
bearer access token and returns this to the client. bearer access token and returns this to the client instance.
Content-type: application/json Content-type: application/json
{ {
"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": [{
"actions": [ "actions": [
skipping to change at page 99, line 41 skipping to change at page 101, line 41
"key": true "key": true
}, },
"uri": "https://server.example.com/continue" "uri": "https://server.example.com/continue"
} }
} }
C.2. Secondary Device Interaction C.2. Secondary Device Interaction
In this scenario, the user does not have access to a web browser on In this scenario, the user does not have access to a web browser on
the device and must use a secondary device to interact with the AS. the device and must use a secondary device to interact with the AS.
The client can display a user code or a printable QR code. The The client instance can display a user code or a printable QR code.
client prefers a short URL if one is available, with a maximum of 255 The client instance is not able to accept callbacks from the AS and
characters in length. The is not able to accept callbacks from the needs to poll for updates while waiting for the user to authorize the
AS and needs to poll for updates while waiting for the user to request.
authorize the request.
The client initiates the request to the AS. The client instance initiates the request to the AS.
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": [
"dolphin-metadata", "some other thing" "dolphin-metadata", "some other thing"
], ],
"client": "7C7C4AZ9KHRS6X63AJAO", "client": "7C7C4AZ9KHRS6X63AJAO",
"interact": { "interact": {
"redirect": 255, "redirect": true,
"user_code": true "user_code": true
} }
} }
The AS processes this and determines that the RO needs to interact. The AS processes this and determines that the RO needs to interact.
The AS supports both long and short redirect URIs for interaction, so The AS supports both redirect URIs and user codes for interaction, so
it includes both. Since there is no "callback" the AS does not it includes both. Since there is no "callback" the AS does not
include a nonce, but does include a "wait" parameter on the include a nonce, but does include a "wait" parameter on the
continuation section because it expects the client to poll for continuation section because it expects the client instance to poll
results. for results.
Content-type: application/json Content-type: application/json
{ {
"interact": { "interact": {
"redirect": "https://srv.ex/MXKHQ", "redirect": "https://srv.ex/MXKHQ",
"user_code": { "user_code": {
"code": "A1BC-3DFF", "code": "A1BC-3DFF",
"url": "https://srv.ex/device" "url": "https://srv.ex/device"
} }
}, },
"continue": { "continue": {
"uri": "https://server.example.com/continue/80UPRY5NM33OMUKMKSKU", "access_token": {
"wait": 60 "value": "80UPRY5NM33OMUKMKSKU",
} "key": true
} },
"uri": "https://server.example.com/continue/VGJKPTKC50",
"wait": 60
}
}
The client saves the response and displays the user code visually on The client instance saves the response and displays the user code
its screen along with the static device URL. The client also visually on its screen along with the static device URL. The client
displays the short interaction URL as a QR code to be scanned. instance also displays the short interaction URL as a QR code to be
scanned.
If the user scans the code, they are taken to the interaction If the user scans the code, they are taken to the interaction
endpoint and the AS looks up the current pending request based on the endpoint and the AS looks up the current pending request based on the
incoming URL. If the user instead goes to the static page and enters incoming URL. If the user instead goes to the static page and enters
the code manually, the AS looks up the current pending request based the code manually, the AS looks up the current pending request based
on the value of the user code. In both cases, the user logs in, is on the value of the user code. In both cases, the user logs in, is
identified as the RO for the resource being requested, and approves identified as the RO for the resource being requested, and approves
the request. Once the request has been approved, the AS displays to the request. Once the request has been approved, the AS displays to
the user a message to return to their device. the user a message to return to their device.
Meanwhile, the client periodically polls the AS every 60 seconds at Meanwhile, the client instance periodically polls the AS every 60
the continuation URL. The client signs the request using the same seconds at the continuation URL. The client instance signs the
key and method that it did in the first request. request using the same key and method that it did in the first
request.
POST /continue/80UPRY5NM33OMUKMKSKU HTTP/1.1 POST /continue/VGJKPTKC50 HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
The AS retrieves the pending request based on the handle and The AS retrieves the pending request based on the handle and
determines that it has not yet been authorized. The AS indicates to determines that it has not yet been authorized. The AS indicates to
the client that no access token has yet been issued but it can the client instance that no access token has yet been issued but it
continue to call after another 60 second timeout. can continue to call after another 60 second timeout.
Content-type: application/json Content-type: application/json
{ {
"continue": { "continue": {
"uri": "https://server.example.com/continue/BI9QNW6V9W3XFJK4R02D", "access_token": {
"wait": 60 "value": "G7YQT4KQQ5TZY9SLSS5E",
} "key": true
} },
"uri": "https://server.example.com/continue/ATWHO4Q1WV",
"wait": 60
}
}
Note that the continuation URL has been rotated since it was used by Note that the continuation URL and access token have been rotated
the client to make this call. The client polls the continuation URL since they were used by the client instance to make this call. The
after a 60 second timeout using the new handle. client instance polls the continuation URL after a 60 second timeout
using this new information.
POST /continue/BI9QNW6V9W3XFJK4R02D HTTP/1.1 POST /continue/ATWHO4Q1WV HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: GNAP Authorization: GNAP G7YQT4KQQ5TZY9SLSS5E
Detached-JWS: ejy0... Detached-JWS: ejy0...
The AS retrieves the pending request based on the URL, determines The AS retrieves the pending request based on the URL and access
that it has been approved, and issues an access token. token, determines that it has been approved, and issues an access
token for the client to use at the RS.
Content-type: application/json Content-type: application/json
{ {
"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": [
"dolphin-metadata", "some other thing" "dolphin-metadata", "some other thing"
] ]
} }
} }
Appendix D. No User Involvement Appendix D. No User Involvement
In this scenario, the client is requesting access on its own behalf, In this scenario, the client instance is requesting access on its own
with no user to interact with. behalf, with no user to interact with.
The client creates a request to the AS, identifying itself with its The client instance creates a request to the AS, identifying itself
public key and using MTLS to make the request. with its public key and using MTLS to make the request.
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
{ {
"resources": [ "resources": [
"backend service", "nightly-routine-3" "backend service", "nightly-routine-3"
], ],
"client": { "client": {
"key": { "key": {
"proof": "mtls", "proof": "mtls",
"cert#S256": "bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2" "cert#S256": "bwcK0esc3ACC3DB2Y5_lESsXE8o9ltc05O89jdN-dg2"
} }
} }
} }
The AS processes this and determines that the client can ask for the The AS processes this and determines that the client instance can ask
requested resources and issues an access token. for the requested resources and issues an access token.
Content-type: application/json Content-type: application/json
{ {
"access_token": { "access_token": {
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0", "value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
"key": true, "key": true,
"manage": "https://server.example.com/token", "manage": "https://server.example.com/token",
"resources": [ "resources": [
"backend service", "nightly-routine-3" "backend service", "nightly-routine-3"
] ]
} }
} }
D.1. Asynchronous Authorization D.1. Asynchronous Authorization
In this scenario, the client is requesting on behalf of a specific In this scenario, the client instance is requesting on behalf of a
RO, but has no way to interact with the user. The AS can specific RO, but has no way to interact with the user. The AS can
asynchronously reach out to the RO for approval in this scenario. asynchronously reach out to the RO for approval in this scenario.
The client starts the request at the AS by requesting a set of The client instance starts the request at the AS by requesting a set
resources. The client also identifies a particular user. of resources. The client instance also identifies a particular user.
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": [
{ {
"type": "photo-api", "type": "photo-api",
skipping to change at page 104, line 51 skipping to change at page 106, line 51
"sub_ids": [ { "sub_ids": [ {
"subject_type": "email", "subject_type": "email",
"email": "user@example.com" "email": "user@example.com"
} ] } ]
} }
} }
The AS processes this and determines that the RO needs to interact. The AS processes this and determines that the RO needs to interact.
The AS determines that it can reach the identified user The AS determines that it can reach the identified user
asynchronously and that the identified user does have the ability to asynchronously and that the identified user does have the ability to
approve this request. The AS indicates to the client that it can approve this request. The AS indicates to the client instance that
poll for continuation. it can poll for continuation.
Content-type: application/json Content-type: application/json
{ {
"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
} }
} }
The AS reaches out to the RO and prompts them for consent. In this The AS reaches out to the RO and prompts them for consent. In this
example, the AS has an application that it can push notifications in example, the AS has an application that it can push notifications in
to for the specified account. to for the specified account.
Meanwhile, the client periodically polls the AS every 60 seconds at Meanwhile, the client instance periodically polls the AS every 60
the continuation URL. seconds at the continuation URL.
POST /continue HTTP/1.1 POST /continue HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: GNAP 80UPRY5NM33OMUKMKSKU Authorization: GNAP 80UPRY5NM33OMUKMKSKU
Detached-JWS: ejy0... Detached-JWS: ejy0...
The AS retrieves the pending request based on the handle and The AS retrieves the pending request based on the handle and
determines that it has not yet been authorized. The AS indicates to determines that it has not yet been authorized. The AS indicates to
the client that no access token has yet been issued but it can the client instance that no access token has yet been issued but it
continue to call after another 60 second timeout. can continue to call after another 60 second timeout.
Content-type: application/json Content-type: application/json
{ {
"continue": { "continue": {
"access_token": { "access_token": {
"value": "BI9QNW6V9W3XFJK4R02D", "value": "BI9QNW6V9W3XFJK4R02D",
"key": true "key": true
}, },
"uri": "https://server.example.com/continue", "uri": "https://server.example.com/continue",
"wait": 60 "wait": 60
} }
} }
Note that the continuation handle has been rotated since it was used Note that the continuation handle has been rotated since it was used
by the client to make this call. The client polls the continuation by the client instance to make this call. The client instance polls
URL after a 60 second timeout using the new handle. the continuation URL after a 60 second timeout using the new handle.
POST /continue HTTP/1.1 POST /continue HTTP/1.1
Host: server.example.com Host: server.example.com
Authorization: GNAP BI9QNW6V9W3XFJK4R02D Authorization: GNAP BI9QNW6V9W3XFJK4R02D
Detached-JWS: ejy0... Detached-JWS: ejy0...
The AS retrieves the pending request based on the handle and The AS retrieves the pending request based on the handle and
determines that it has been approved and it issues an access token. determines that it has been approved and it issues an access token.
Content-type: application/json Content-type: application/json
skipping to change at page 106, line 47 skipping to change at page 108, line 47
HTTP 302 Found HTTP 302 Found
Location: https://server.example.com/authorize Location: https://server.example.com/authorize
?client_id=7C7C4AZ9KHRS6X63AJAO ?client_id=7C7C4AZ9KHRS6X63AJAO
&scope=read%20write%20dolphin &scope=read%20write%20dolphin
&redirect_uri=https://client.example.net/return &redirect_uri=https://client.example.net/return
&response_type=code &response_type=code
&state=123455 &state=123455
Now the developer wants to make an analogous request to the AS using Now the developer wants to make an analogous request to the AS using
the new protocol. To do so, the client makes an HTTP POST and places GNAP. To do so, the client instance makes an HTTP POST and places
the OAuth 2 values in the appropriate places. the OAuth 2 values in the appropriate places.
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": [
"read", "write", "dolphin" "read", "write", "dolphin"
skipping to change at page 107, line 25 skipping to change at page 109, line 25
"interact": { "interact": {
"redirect": true, "redirect": true,
"callback": { "callback": {
"method": "redirect", "method": "redirect",
"uri": "https://client.example.net/return?state=123455", "uri": "https://client.example.net/return?state=123455",
"nonce": "LKLTI25DK82FX4T4QFZC" "nonce": "LKLTI25DK82FX4T4QFZC"
} }
} }
} }
The client_id can be used to identify the client's keys that it uses The client_id can be used to identify the client instance's keys that
for authentication, the scopes represent resources that the client is it uses for authentication, the scopes represent resources that the
requesting, and the "redirect_uri" and "state" value are pre-combined client instance is requesting, and the "redirect_uri" and "state"
into a "callback" URI that can be unique per request. The client value are pre-combined into a "callback" URI that can be unique per
additionally creates a nonce to protect the callback, separate from request. The client instance additionally creates a nonce to protect
the state parameter that it has added to its return URL. the callback, separate from 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
GNAP makes use of polymorphism within the JSON [RFC8259] structures GNAP makes use of polymorphism within the JSON [RFC8259] structures
used for the protocol. Each portion of this protocol is defined in used for the protocol. Each portion of this protocol is defined in
terms of the JSON data type that its values can take, whether it's a terms of the JSON data type that its values can take, whether it's a
string, object, array, boolean, or number. For some fields, string, object, array, boolean, or number. For some fields,
different data types offer different descriptive capabilities and are different data types offer different descriptive capabilities and are
skipping to change at page 108, line 13 skipping to change at page 110, line 14
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
JSON, each data type for an object member field is naturally mutually JSON, each data type for an object member field is naturally mutually
exclusive with other data types within a single JSON object. exclusive with other data types within a single JSON object.
For example, a resource request for a single access token is composed For example, a resource request for a single access token is composed
of an array of resource request descriptions while a request for of an array of resource request descriptions while a request for
multiple access tokens is composed of an object whose member values multiple access tokens is composed of an object whose member values
are all arrays. Both of these represent requests for access, but the are all arrays. Both of these represent requests for access, but the
difference in syntax allows the RC and AS to differentiate between difference in syntax allows the client instance and AS to
the two request types in the same request. differentiate between the two request types in the same request.
Another form of polymorphism in JSON comes from the fact that the Another form of polymorphism in JSON comes from the fact that the
values within JSON arrays need not all be of the same JSON data type. values within JSON arrays need not all be of the same JSON data type.
However, within this protocol, each element within the array needs to However, within this protocol, each element within the array needs to
be of the same kind of semantic element for the collection to make be of the same kind of semantic element for the collection to make
sense, even when the data types are different from each other. sense, even when the data types are different from each other.
For example, each aspect of a resource request can be described using For example, each aspect of a resource request can be described using
an object with multiple dimensional components, or the aspect can be an object with multiple dimensional components, or the aspect can be
requested using a string. In both cases, the resource request is requested using a string. In both cases, the resource request is
being described in a way that the AS needs to interpret, but with being described in a way that the AS needs to interpret, but with
different levels of specificity and complexity for the RC to deal different levels of specificity and complexity for the client
with. An API designer can provide a set of common access scopes as instance to deal with. An API designer can provide a set of common
simple strings but still allow RC developers to specify custom access access scopes as simple strings but still allow RC developers to
when needed for more complex APIs. specify custom access when needed for more complex APIs.
Extensions to this specification can use different data types for Extensions to this specification can use different data types for
defined fields, but each extension needs to not only declare what the defined fields, but each extension needs to not only declare what the
data type means, but also provide justification for the data type data type means, but also provide justification for the data type
representing the same basic kind of thing it extends. For example, representing the same basic kind of thing it extends. For example,
an extension declaring an "array" representation for a field would an extension declaring an "array" representation for a field would
need to explain how the array represents something akin to the non- need to explain how the array represents something akin to the non-
array element that it is replacing. array element that it is replacing.
Authors' Addresses Authors' Addresses
 End of changes. 397 change blocks. 
1475 lines changed or deleted 1575 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/