Re: [GNAP] Addition of optional 'access_token' in interact callback section

Justin Richer <> Fri, 21 January 2022 18:42 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 1F5713A0958 for <>; Fri, 21 Jan 2022 10:42:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.497
X-Spam-Status: No, score=-1.497 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, KHOP_HELO_FCRDNS=0.399, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id WgTSDSPqfM7E for <>; Fri, 21 Jan 2022 10:42:12 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 7EE323A0923 for <>; Fri, 21 Jan 2022 10:42:12 -0800 (PST)
Received: from ( []) (authenticated bits=0) (User authenticated as jricher@ATHENA.MIT.EDU) by (8.14.7/8.12.4) with ESMTP id 20LIgAJS007039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 13:42:10 -0500
From: Justin Richer <>
Message-Id: <>
Content-Type: multipart/alternative; boundary="Apple-Mail=_7BE5C52E-4070-4167-9F8F-C04C6DEDCB55"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.\))
Date: Fri, 21 Jan 2022 13:42:09 -0500
Cc: "" <>
To: Mike Varley <>
References: <YT1PR01MB30997386FF4252950B34E9F2E4549@YT1PR01MB3099.CANPRD01.PROD.OUTLOOK.COM> <YT1PR01MB3099EEADBB4C78C6BD0807D5E45B9@YT1PR01MB3099.CANPRD01.PROD.OUTLOOK.COM>
X-Mailer: Apple Mail (2.3654.
Archived-At: <>
Subject: Re: [GNAP] Addition of optional 'access_token' in interact callback section
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: GNAP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 21 Jan 2022 18:42:17 -0000

Hi Mike, thanks for bringing this to the WG. My gut instinct is that we could potentially re-use a similar construct we have in other parts of the protocol, where we’re sending a URI and an access token to use at the URI, with all of its parameters. I think it’s important that we don’t slip into the OAuth 2 over-simplification of “access_token” being a simple string value, because then you need to invent a whole bunch of other things to talk about non-bearer tokens or other attributes. But we could take the same kind of construct we use for the continuation endpoint response and use it again with what you have below: you have a  URI and an access token, and the access token is a fully defined GNAP access token structure. So the “continue” section looks like this:

    "continue": {
        "access_token": {
            "value": "80UPRY5NM33OMUKMKSKU"
        "uri": "",
        "wait": 60
The access token here is, by default, bound to the client’s presented key — it’s the same structure that you get back from a “real” access token response, only embedded. This is what I’m thinking that might look like in the example below:

    "client" : "",
    "access_token" : {
        "access" : [  "idproof1"],
        "flags" : "bearer"
    "interact" : {
        "start" : [ "app", "user_code" ],
        "finish" : {
            "method" : "push",
            "nonce" : "client_nonce_random",
            "uri" : "",
            "access_token" : {
		“value”: “callback_access_token”,
		“flags”: [ “bearer” ]

This way, we’re not inventing a new structure, it’s just another GNAP token. And  yes, it would need to be optional, and only defined for the “push” method (at least with what’s defined in core). 

I agree that the security and privacy considerations of something like this would be pretty intense, though, since now we’re having the client instance create and manage a token. Maybe it’s a good extension? But if so, how can we define the “finish” section such that it can be extended this way?

Would love to hear if anyone else has this use case, too.

 — Justin

> On Jan 21, 2022, at 9:39 AM, Mike Varley <> wrote:
> Hello GNAP’ers,
> I would like to float the idea of adding an optional core parameter to the ‘interact’ request object parameter called ‘access_token’. Specifically relevant to the finish.method = push function.
> For example:
> {
>     "client" : " <>",
>     "access_token" : {
>         "access" : [  "idproof1"],
>         "flags" : "bearer"
>     }
>     "interact" : {
>         "start" : [ "app", "user_code" ],
>         "finish" : {
>             "method" : "push",
>             "uri" : " <>",
>             "nonce" : "client_nonce_random",
>             "access_token" : "callback_access_token"
>         }
>     }
> }
> The result of the above would be that when the POST callback is made to the client API endpoint, the bearer access token would be included as authorization.
> The motivation is clients who have API endpoints may require that all API calls be made with an access token -  there are no open server API endpoints. The motivation for including it in the core spec is too ensure there is a standard way of providing this security parameter, and AS developers are not left re-inventing this parameter for clients. Some clients I have worked with have been adverse to putting access tokens in the URI as parameters as these may get logged by proxies and gateways.
> There are a couple drawbacks that I see to supporting this parameter; first, it currently only covers “bearer” tokens – so other security parameters or requirements either get included (making the protocol and the AS life much more difficult), and second there wouldn’t be much guidance on how the client is expected to generate this access token (most access_token generating services require a client request to kick things off…) and then this may cascade into more complicated nuanced steps.
> I am very much interested in other’s experience on this topic; “this is a good idea/bad idea because…” and also “this should be core/extension because”. I believe adding lots of optional parameters for not-so-well defined use cases that may never practically occur in the wild to be detrimental to a spec as it just leads to more developer guesswork and customization, so I would like to avoid that also :)
> Thanks all!
> MV
> ---
> Mike Varley                              <>
> Architect – Office of the CTO
> SecureKey Technologies Inc. 
> This email and any attachments are for the sole use of the intended recipients and may be privileged, confidential or otherwise exempt from disclosure under law. Any distribution, printing or other use by anyone other than the intended recipient is prohibited. If you are not an intended recipient, please contact the sender immediately, and permanently delete this email and its attachments.
> -- 
> TXAuth mailing list
> <>
> <>