Re: [OAUTH-WG] Dynamic Scopes

Torsten Lodderstedt <torsten@lodderstedt.net> Fri, 22 June 2018 20:31 UTC

Return-Path: <torsten@lodderstedt.net>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A43F3130EEB for <oauth@ietfa.amsl.com>; Fri, 22 Jun 2018 13:31:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.621
X-Spam-Level:
X-Spam-Status: No, score=-2.621 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTnPabUZdj8I for <oauth@ietfa.amsl.com>; Fri, 22 Jun 2018 13:31:54 -0700 (PDT)
Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5DE32130EE7 for <oauth@ietf.org>; Fri, 22 Jun 2018 13:31:54 -0700 (PDT)
Received: from [84.158.233.58] (helo=[192.168.71.123]) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <torsten@lodderstedt.net>) id 1fWSil-00041V-46; Fri, 22 Jun 2018 22:31:51 +0200
From: Torsten Lodderstedt <torsten@lodderstedt.net>
Message-Id: <00432150-20C0-4B5F-AB4E-92F96B968A3A@lodderstedt.net>
Content-Type: multipart/signed; boundary="Apple-Mail=_67D602A6-C049-4871-B9DE-784830A235A4"; protocol="application/pkcs7-signature"; micalg="sha1"
Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\))
Date: Fri, 22 Jun 2018 22:31:45 +0200
In-Reply-To: <b9e4115a-512d-3155-9023-604566d7190f@aol.com>
Cc: Brian Campbell <bcampbell=40pingidentity.com@dmarc.ietf.org>, oauth <oauth@ietf.org>
To: George Fletcher <gffletch@aol.com>
References: <291DC85D-66B4-403F-8159-52D0091F7631@lodderstedt.net> <CA+k3eCQMCJv3NcSnBDKBUVcm131oMAdnbopSeAaD75acAqUMwg@mail.gmail.com> <b9e4115a-512d-3155-9023-604566d7190f@aol.com>
X-Mailer: Apple Mail (2.3445.8.2)
X-Df-Sender: dG9yc3RlbkBsb2RkZXJzdGVkdC5uZXQ=
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/DkTlmgyTxTerRXSSbaL-ma7kYSM>
Subject: Re: [OAUTH-WG] Dynamic Scopes
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Jun 2018 20:31:58 -0000

Hi George, 

> Am 22.06.2018 um 19:51 schrieb George Fletcher <gffletch@aol.com>:
> 
> I like the concept of parameterized scopes but I'm not sure they should be used for per-transaction use cases. It seems like the use cases presented are about operating on parameters specific to the transaction. Why are these part of the authorization flow?

The access token is good for a certain transaction only. In case of a electronic signature, the access token is bound to a certain document or a set of documents.

> 
> Is the goal to bind an access token to a particular transaction? If this is the case, would it not be better to either extend the refresh_token flow or may better yet, create a new grant_type that takes the refresh_token and additional "binding" parameters and then have that return the "bound" access token to be used for the transaction.

What would be the scope of such a refresh token? 

> 
> Maybe this is similar to what Nat is describing with the staging API?

The staging API represents the data of a certain transaction in a resource, which allows to parametrize the scope just with the identifier of that resource. So the transaction data can be transmitted in a robust fashion. 

best regards,
Torsten. 

> 
> Thanks,
> George
> 
> On 6/20/18 5:58 PM, Brian Campbell wrote:
>> In my own personal and humble opinion, Torsten, what you describe as "(1) Parameter is part of the scope value" is the most natural approach and works without needing changes to, or going outside of, RFC6749 The OAuth 2.0 Authorization Framework. There may be AS implementations that have made assumption about scope values being static (I know of at least one!) but that's an implementation/feature issue, which can change, and not a spec issue.
>> 
>> The OIDC "claims" parameter is already a bit of a hairy beast and I think using it and the ID Token to convey more dynamic access/authorization is blurring the line between authorization and authentication a bit much. Also, as others have pointed out, OIDC isn't always in play - particularly for regular old authorization cases.  
>> 
>> An additional query parameter might be simple for a one-off case but it's nonstandard and not very repeatable. 
>> 
>> 
>> On Mon, Jun 18, 2018 at 9:34 AM, Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
>> Hi all,
>> 
>> I have been working lately on use cases where OAuth is used to authorize transactions in the financial sector and electronic signing. What I learned is there is always the need to pass resource ids (e.g. account numbers) or transaction-specific values (e.g. amount or hash to be signed) to the OAuth authorization process to further qualify the scope of the requested access token. 
>> 
>> It is obvious a static scope value, such as „payment“or „sign“, won’t do the job. For example in case of electronic signing, one must bind the authorization/access token to a particular document, typically represented by its hash.
>> 
>> I would like to get your feedback on what you consider a good practice to cope with that challenge. As a starting point for a discussion, I have assembled a list of patterns I have seen in the wild (feel free to extend). 
>> 
>> (1) Parameter is part of the scope value, e.g. „sign:<hash_to_be_signed>“ or "payments:<payment_resource_id>" - I think this is an obvious way to represent such parameters in OAuth, as it extends the scope parameter, which is intended to represent the requested scope of an access token. I used this pattern in the OAuth SCA mode in Berlin Group's PSD API. 
>> 
>> (2) One could also use additional query parameter to add further details re the requested authorization, e.g. 
>> 
>> GET /authorize?
>> .....
>> &scope=sign
>> .....
>> &hash_to_be_signed=<hash_to_be_signed>
>> 
>> It seems to be robust (easier to implement?) but means the scope only represents the static part of the action. The AS needs to look into a further parameter to fully understand the requested authorization. 
>> 
>> (3) Open Banking UK utilizes the (OpenID Connect) „claims“ parameter to carry additional data. 
>> 
>> Example:  
>> 
>> "claims": {
>>     "id_token": {
>>         "acr": {
>>             "essential": true,
>>             "value": "..."
>>           },
>>         "hash_to_be_signed": {
>>             "essential": true,
>>             "value": "<hash_to_be_signed>"
>>         }
>>     },
>>     "userinfo": {
>>         "hash_to_be_signed": {
>>             "essential": true,
>>             "value": "<hash_to_be_signed>"
>>         }
>>     }
>>   }
>> 
>> I‘m looking forward for your feedback. Please also indicated whether you think we should flush out a BCP on that topic. 
>> 
>> kind regards,
>> Torsten.
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>> 
>> 
>> 
>> CONFIDENTIALITY NOTICE: This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited..  If you have received this communication in error, please notify the sender immediately by e-mail and delete the message and any file attachments from your computer. Thank you. 
>> 
>> _______________________________________________
>> OAuth mailing list
>> 
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>