Re: [OAUTH-WG] Rich Authorization Requests feedbacks on implementation

Justin Richer <jricher@mit.edu> Wed, 13 January 2021 21:52 UTC

Return-Path: <jricher@mit.edu>
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 86E643A16D9; Wed, 13 Jan 2021 13:52:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Level:
X-Spam-Status: No, score=-1.919 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 7enmW31tYsxD; Wed, 13 Jan 2021 13:52:48 -0800 (PST)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (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 044853A16BA; Wed, 13 Jan 2021 13:52:01 -0800 (PST)
Received: from [192.168.1.22] (static-71-174-62-56.bstnma.fios.verizon.net [71.174.62.56]) (authenticated bits=0) (User authenticated as jricher@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 10DLpx4i022311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Jan 2021 16:52:00 -0500
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
From: Justin Richer <jricher@mit.edu>
In-Reply-To: <511128bf-348f-fc92-ddf1-9598502a20a9@babelouest.org>
Date: Wed, 13 Jan 2021 16:51:59 -0500
Cc: oauth <oauth@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <0062E5EE-4AD3-47FE-A81A-6D724B001929@mit.edu>
References: <511128bf-348f-fc92-ddf1-9598502a20a9@babelouest.org>
To: Nicolas Mora <nicolas=40babelouest.org@dmarc.ietf.org>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/6Hw5-1P14k9-de0Ndfc47LRxjEg>
Subject: Re: [OAUTH-WG] Rich Authorization Requests feedbacks on implementation
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 13 Jan 2021 21:52:57 -0000

Hi Nicolas,

> On Jan 10, 2021, at 8:36 PM, Nicolas Mora <nicolas=40babelouest.org@dmarc.ietf.org> wrote:
> 
> Hello,
> 
> I've implemented Rich Authorization Requests defined in draft-ietf-oauth-rar-03 for Glewlwyd soon-to-be-released 2.5 [1], and I humbly wanted to write my feedback about this implementation to share my experience.
> 

> For starters, this implementation and my following feedbacks are based on the prism of Glewlwyd's implementation and philosophy, and my limited experience on OAuth2, so I appologize in advance if I write non-sense or big mistakes.
> 

Thanks for reaching out! Implementation experience is incredibly valued here in the IETF, especially when someone’s coming to the spec from “outside” the community. :)

> 1 - Design
> 
> The way I saw it, there are 2 different approaches to implement oauth2 rar: either to get a token with a more detailed scope, or to get a one-time token with extra grants.
> 
> Both are not exclusive, but a big difference I see between those 2 approaches is the grant access from the user part. The second approach would require the user to know what extra grant is asked by the client every time the client asks for it, i.e. when the client redirects the user to the /authorization endpoint.
> 
> To be more consistent with Glewlwyd's philosophy, I chose the first approach, with those rules.
> The AS administrator declares what rar types are allowed [2]
>  - a rar type has a defined set of locations, actions, datatypes and enriched authorization details that the client can ask for
>  - the client must be explicitly allowed to add a rar type in the authorization request
>  - a rar type can be linked to one or more scope. In that case, the authorization request must include at least one of the linked scope, and the scope must be available for the user and the scope must be granted to the client
>  - the client can add as many properties as required in the rar type, those extra properties are not verified by the AS, on access granted, the extra properties will be present in the "authorization_details" result.
> 

I think this is an interesting approach, but I’m not sure about a few things:

- What’s the utility of linking to a scope. Why require both structures to be interpreted together like that?
- There will absolutely be implementations that do not limit which RAR types (or even values) the client is allowed to send, much like there are implementations today that don’t restrict scopes on a per-client basis.
- I don’t think that we can say the AS doesn’t verify “extra required properties”, since the AS can (and arguably should) know about the details of the “type” being used, and enforce internal consistency and structure.

> On first use of a rar type by a client for a user, the user must grant to the client the rar access [3]. That's why the grant message will show to the user ALL access possible via this rar type
> Once this access is granted or not, the user will not be asked again on another authorization request by the client (but is can be changed at any time, as a scope grant).
> 

It’s always up to the AS to determine what the granted access is, whether it’s for a new token, a limitation of existing grant (via refresh token), or a client asking for something “additional” for whatever purpose. 

> 2 - Limitations
> 
> In this design, the AS has a limited control over the authorization_details content, and the trust between the AS and the client must be high enough so if a rar type can gain access to sensitive actions or information, the user should know about it.

The AS has full control to interpret the authorization_details content, and apply it to access token granting policies, which include whether to ask the user to grant anything. 

> 
> Also, in the draft specification, the only mandatory element type in a rar is the "type" element. In my point of view, this means that the business logic is mostly defined by the RS, rather than the AS.

Just like “scope” in OAuth, it’s ultimately enforced by the RS, but the AS works in the process to interpret and potentially modify the meaning of the scope. 

> 
> Therefore, for a client implementation to be compliant with the specs, there's not much to do: add as a parameter a JSON array with objects containing at least one "type" string property in it.
> 

Yup — and even more, most clients will be sending in static or templated values that the developers get from documentation, much like they do with scopes in APIs today. Keeping it simple for clients is definitely a goal!

> 3 - Extensions
> 
> I believe one way to mitigate these limitations is to allow extensions to be defined on top of the rar specifications. An extension can be declared like this:
> 
> "RAR Extension XYZ:
> A rar whose type is XXX
> - Actions available: YYY, ZZZ or AAA
> - datatypes possibles: BBB, CCC, DDD or EEE
> - additional elements mandatory: an array of FFF and an object of GGG to represent access to some"
> 
> Like this, if the AS, the RS and the client agree on using a rar extension, they can have at least a detailed pattern on what to expect in the rar type.

I like that structure, but not for “extensions” exactly; more properly, I think this can be some guidance on how to create a RAR “type” definition. This fits with the philosophy of “type” defining what’s allowed to go in the object, but it would allow for a more formal definition of what that connection is. Should this be normative, or just informative, though? I’m not sure yet — I will try to come up with some proposed text on that and propose a PR.

 — Justin

> 
> Any thoughts?
> 
> /Nicolas
> 
> [1] https://github.com/babelouest/glewlwyd
> [2] https://raw.githubusercontent.com/babelouest/glewlwyd/master/docs/screenshots/plugin-oidc-rar.png
> [3] https://raw.githubusercontent.com/babelouest/glewlwyd/master/docs/screenshots/login-rar-grant.png
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth