Re: [OAUTH-WG] draft-bertocci-oauth-access-token-jwt-00

Binningsbø, Jørgen <Jorgen.Binningsbo@difi.no> Tue, 26 March 2019 16:35 UTC

Return-Path: <Jorgen.Binningsbo@difi.no>
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 EC8BE1205E6 for <oauth@ietfa.amsl.com>; Tue, 26 Mar 2019 09:35:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.92
X-Spam-Level:
X-Spam-Status: No, score=-0.92 tagged_above=-999 required=5 tests=[AC_DIV_BONANZA=0.001, BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FROM_EXCESS_BASE64=0.979, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=difidrift.onmicrosoft.com
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 2s_gD6j8mm8g for <oauth@ietfa.amsl.com>; Tue, 26 Mar 2019 09:35:18 -0700 (PDT)
Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140058.outbound.protection.outlook.com [40.107.14.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5F4071206B2 for <oauth@ietf.org>; Tue, 26 Mar 2019 09:35:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=difidrift.onmicrosoft.com; s=selector1-difi-no; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LaJmJU+sotKN5HGNDGGVi6bB6qzeOElGdaW/sZBodNU=; b=lB2xhyWgzhsPsQSE0vplR9tM/u6+9eCdyzb1E4ps6E7B5HOeenxgY+KRzfSOGlWGbKJAXdcl34wi5Nm5xF3KL8dO7t3RPZ69I+Em0vWOO/17XSfWmNe5FO5To4dqaZi3rjpQLadJg5ywVUlPTFKc1ZNKcF3n6b3yyIftYjQVxIg=
Received: from HE1PR0102MB2585.eurprd01.prod.exchangelabs.com (10.170.251.138) by HE1PR0102MB3084.eurprd01.prod.exchangelabs.com (10.167.35.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Tue, 26 Mar 2019 16:35:02 +0000
Received: from HE1PR0102MB2585.eurprd01.prod.exchangelabs.com ([fe80::bc28:a6c2:2867:f6d]) by HE1PR0102MB2585.eurprd01.prod.exchangelabs.com ([fe80::bc28:a6c2:2867:f6d%4]) with mapi id 15.20.1730.019; Tue, 26 Mar 2019 16:35:02 +0000
From: "Binningsbø, Jørgen" <Jorgen.Binningsbo@difi.no>
To: Dave Tonge <dave.tonge@momentumft.co.uk>, Dominick Baier <dbaier@leastprivilege.com>
CC: IETF oauth WG <oauth@ietf.org>
Thread-Topic: [OAUTH-WG] draft-bertocci-oauth-access-token-jwt-00
Thread-Index: AQHU4plzwvKjf6KddUWNfr1RQV+wAKYbvMyAgACe2ICAAAThAIAAC2CAgAABTACAAJjzgIAADBmAgABhiACAACJSAIAAgWGw
Date: Tue, 26 Mar 2019 16:35:01 +0000
Message-ID: <HE1PR0102MB2585D9664A190C7EC7000BD7F75F0@HE1PR0102MB2585.eurprd01.prod.exchangelabs.com>
References: <CAO_FVe6eWy3zppQAij7qxD+ycYL8ebqGJKG0y-A7GhN+0=kb4g@mail.gmail.com> <B755AE4D-2D10-4380-AC12-4B7A8F53B812@gmail.com> <CAO7Ng+siADYHEhr8gryPZ_6c50uQ3XxDM5inAFwgG+Xa0bnwfg@mail.gmail.com> <CA+iA6uhHOSmiSG_vxvad_g2ufi57OS4TxdvoO20g+7vm7rNZiA@mail.gmail.com> <CAO7Ng+vGC5ByU1wZrbNWvaZ+QuDByhJ8huw8UXVxfOCWQpaH1w@mail.gmail.com> <CA+iA6ujkEMdHPMn7JQLts7OAusV3ieKKMon572vTACtFvTGnrA@mail.gmail.com> <CAO_FVe73L7B-_7gu1W0N-mqLXHQExef4QKDeaWHrUmJnCCxCRg@mail.gmail.com> <D610AAEA-892F-4AAD-915D-A0C068F5BFD3@gmail.com> <CAO7Ng+sqzw4O2vt+iCWegBWBGg+-oyqV1j8dF7ADK2TbPec_CQ@mail.gmail.com> <CAP-T6TRwmzJBwgNJe5EOTHQi6LCvjyYtXgXqnPpr=B0x0vBANA@mail.gmail.com>
In-Reply-To: <CAP-T6TRwmzJBwgNJe5EOTHQi6LCvjyYtXgXqnPpr=B0x0vBANA@mail.gmail.com>
Accept-Language: nb-NO, en-US
Content-Language: nb-NO
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jorgen.Binningsbo@difi.no;
x-originating-ip: [79.170.81.253]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: c533531a-9e87-43e0-239b-08d6b208fe9f
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:HE1PR0102MB3084;
x-ms-traffictypediagnostic: HE1PR0102MB3084:
x-ms-exchange-purlcount: 4
x-microsoft-antispam-prvs: <HE1PR0102MB3084B7CE4FBCF7A84A6CE0A1F75F0@HE1PR0102MB3084.eurprd01.prod.exchangelabs.com>
x-forefront-prvs: 09888BC01D
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(39850400004)(136003)(396003)(376002)(346002)(366004)(51914003)(189003)(199004)(52314003)(25786009)(110136005)(7736002)(2906002)(476003)(54896002)(97736004)(85182001)(14444005)(256004)(71190400001)(71200400001)(14454004)(8936002)(486006)(6306002)(6116002)(5660300002)(7696005)(66066001)(74482002)(236005)(4326008)(30864003)(9686003)(186003)(45080400002)(52536014)(53936002)(66574012)(53386004)(8676002)(55016002)(106356001)(68736007)(11346002)(26005)(85202003)(74316002)(446003)(3846002)(102836004)(478600001)(6436002)(5070765005)(93886005)(33656002)(53546011)(517774005)(606006)(76176011)(6506007)(966005)(81166006)(316002)(81156014)(99286004)(86362001)(72206003)(105586002)(777600001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0102MB3084; H:HE1PR0102MB2585.eurprd01.prod.exchangelabs.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: difi.no does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: 6S2ijetImx03ne+MlstoTO9LW/sV2WHEX+LhIF9a/yoXt2zdUddYUe1wCB3uVtGtk6xf7F6gHLcsey0kgW9tdlOfwjLZ8son0NGvSKKZAamhi6tEQjC+EOoKqHcky9jShoW1co+S/d9ifpQuyeWsa6J4jQV9zKvNESsCW/L+oZRNRqgSzd/SFVWO94jKh3JApJK641YdCXtd9W96kfC14WpQhtpiQospFwKT2Ej7EvvJZzzG7G41gjEmbgNcjXgSCFAszOkiUpjoGHOxUGnEOHLxqEMsOFiFR5ec1cDjBDJDhG6Qu55HNDQfIXxnOp3IORzZligXrK9Swq+PdiVunmqLRLyO0Am8HeWSLaC+Lei0bYQlEATaA2/aUSXAG4/Iprw7Ix02KuwyDRKf5WQJT/PVVRMv3S1qZeOwJ7ceVy8=
Content-Type: multipart/alternative; boundary="_000_HE1PR0102MB2585D9664A190C7EC7000BD7F75F0HE1PR0102MB2585_"
MIME-Version: 1.0
X-OriginatorOrg: difi.no
X-MS-Exchange-CrossTenant-Network-Message-Id: c533531a-9e87-43e0-239b-08d6b208fe9f
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 16:35:01.9367 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 250f5e75-599c-4614-9707-0ced6114ffc6
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0102MB3084
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/THvjbZiyVzP4LhV8HfKaEPQwBow>
X-Mailman-Approved-At: Fri, 05 Apr 2019 10:43:30 -0700
Subject: Re: [OAUTH-WG] draft-bertocci-oauth-access-token-jwt-00
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: Tue, 26 Mar 2019 16:37:04 -0000

Hi,



We have a machine-to-machine scenario where clients, RSes and our AS all belong to different legal entities.



Some RSes require their clients to limit the access token to a specific Resource Owner, while other RSes don't. In the former case, we use 'sub' to identify that Resource Owner.  In such a mixed deployment scenario, allowing using 'sub' for different meanings can lead to confusion, so I think the actual meaning should be explicitly signalled like Dave suggests below.



Having said that, I do prefer to limit the usage of 'sub' in access tokens for the End User only.





As a side note, in our case we need a more formal client identification than the client_id alone (as they are randomly generated by DCR),  and have thus opted for a custom claim `client_owner` containing the registered company identifier.  We pull this out from certificate used to sign the JWT-grant (RFC7523) from the token request.   We could of course have used ‘sub’ for client_owner, but that would require us to invent another custom claim for those RSes that requires RO-limited tokens.    To make matters even more complicated, there might be business delegation happening,  where company A running the client is acting on behalf of different other companies B,C,D… and the instantaneous A+B or A+C relation also have to be communicated in the token  (According to EU privacy laws, I belive A is the Data Processor and their customer B,C,D… are Data Controller).   So again this leads me to think that client identification should be kept in separate claims.



Anyway, for us as user of the oauth2 protocols, this draft is welcome !





Kind regards,
--
Jørgen Binningsbø
Product Owner, Norwegian National eID Infrastructure (ID-porten)

Fra: OAuth <oauth-bounces@ietf.org> På vegne av Dave Tonge
Sendt: tirsdag 26. mars 2019 09.27
Til: Dominick Baier <dbaier@leastprivilege.com>
Kopi: IETF oauth WG <oauth@ietf.org>
Emne: Re: [OAUTH-WG] draft-bertocci-oauth-access-token-jwt-00

Thanks Vittorio for your presentation and putting this draft together.

I agree with Dominck that there is a potential of things going wrong when `sub` has multiple meanings.
However I can see that using `sub` for a client_id semantically makes sense in some situations and I agree that it makes it simpler from an SDK point of view for there to always be a `sub`.

My suggestion would be that either there is an explicit type to differentiate between "user access tokens" and "application access tokens", or failing that the `sub` is used to indicate the difference.

Furthermore an agreement on the naming and description of these two types of access tokens would be helpful more generally.

Dave

On Tue, 26 Mar 2019 at 07:25, Dominick Baier <dbaier@leastprivilege.com<mailto:dbaier@leastprivilege.com>> wrote:
From an access token consumer (aka API) developer point of view, I prefer this logic

"If sub is present - client acts on behalf of a user, if not - not."

Anything more complicated has a potential of going wrong.



On 26. March 2019 at 01:34:53, Nov Matake (matake@gmail.com<mailto:matake@gmail.com>) wrote:
Hi Vittorio,

Yeah, I’m concerning user & client ids collision.
I haven’t seen such implementations, but user-select username as sub, or incremental integer as sub & client_id will be easily collide.

If you can enforce collision resistant IDs between user & client instances, it’ll works fine. I feel its overkill though.

Sent from my iPhone

On Mar 26, 2019, at 8:51, Vittorio Bertocci <Vittorio@auth0.com<mailto:Vittorio@auth0.com>> wrote:
Hey Nov, Dominick, Hans-
thanks for the comments. That was an area I was expecting to cause more discussion, and I am glad we are having this opportunity to clarify.
The current language in the draft traces the etymology of sub to OpenID Connect core, hence Dominick observation is on point. However in the description I express something in line with 7519, which was in fact my intent.

The idea was to provide an identifier of the calling subject that is guaranteed to be present in all cases- this would allow an SDK developer to use the same code for things like lookups and membership checks regardless of the nature of the caller (user in a delegated case, app in app-only grants). The information to discriminate between user and app callers is always available in the token (say, the caller is a user if sub!=client_id, where client_id is always guaranteed to be present as well) hence there's no loss in expressive power, should that difference be relevant for the resource server.

Dominick, Hans- I probably missed the security issue you guys are thinking of in this case. Of course, if this would introduce a risk I completely agree it should be changed- I'd just like to understand better the problem. Could you expand it in a scenario/use case to clarify the risk?
Nov- playing this back: is the concern that a user and a client might have the same identifier within an IDP? When using collision resistant IDs, as it is usually the case, that seems to be a remote possibility- did you stumble in such scenario in production?

Thanks
V.


On Mon, Mar 25, 2019 at 7:44 AM Hans Zandbelt <hans.zandbelt@zmartzone.eu<mailto:hans.zandbelt@zmartzone.eu>> wrote:
I believe there are plenty of OAuth 2.0 only use cases out there... but nevertheless I agree with the potential confusion and thus security problems arising from that (though one may argue the semantics are the same).

Hans.

On Mon, Mar 25, 2019 at 3:39 PM Dominick Baier <dbaier@leastprivilege.com<mailto:dbaier@leastprivilege.com>> wrote:
Yes I know - and I think in hindsight it was a mistake to use the same claim type for multiple semantics.

All the “this is OIDC not OAuth” arguments are making things more complicated than they need to be - in my experience almost no-one (that I know) does OIDC only - nor OAuth only. They always combine it.

In reality this leads to potential security problems - this spec has the potential to rectify the situation.

Dominick


On 25. March 2019 at 14:58:56, Hans Zandbelt (hans.zandbelt@zmartzone.eu<mailto:hans.zandbelt@zmartzone.eu>) wrote:
Without agreeing or disagreeing: OIDC does not apply here since it is not OAuth and an access token is not an id_token.
The JWT spec says in https://tools.ietf.org/html/rfc7519#section-4.1.2:

"The "sub" (subject) claim identifies the principal that is the
   subject of the JWT.  The claims in a JWT are normally statements
   about the subject.  The subject value MUST either be scoped to be
   locally unique in the context of the issuer or be globally unique.
   The processing of this claim is generally application specific"

which kind of spells "client" in case of the client credentials grant but I also do worry about Resource Servers thinking/acting only in terms of users

Hans.

On Mon, Mar 25, 2019 at 2:41 PM Dominick Baier <dbaier@leastprivilege.com<mailto:dbaier@leastprivilege.com>> wrote:
IMHO the sub claim should always refer to the user - and nothing else.

OIDC says:

"Subject - Identifier for the End-User at the Issuer."

client_id should be used to identify clients.

cheers
Dominick


On 25.. March 2019 at 05:13:03, Nov Matake (matake@gmail.com<mailto:matake@gmail.com>) wrote:
Hi Vittorio,

Thanks for the good starting point of standardizing JWT-ized AT.

One feedback.
The “sub” claim can include 2 types of identifier, end-user and client, in this spec.
It requires those 2 types of identifiers to be unique each other in the IdP context.

I prefer omitting “sub” claim in 2-legged context, so that no such constraint needed.

thanks

nov


On Mar 25, 2019, at 8:29, Vittorio Bertocci <vittorio.bertocci=40auth0.com@dmarc.ietf.org<mailto:vittorio.bertocci=40auth0.com@dmarc.ietf.org>> wrote:

Dear all,
I just submitted a draft describing a JWT profile for OAuth 2.0 access tokens. You can find it in https://datatracker.ietf.org/doc/draft-bertocci-oauth-access-token-jwt/.
I have a slot to discuss this tomorrow at IETF 104 (I'll be presenting remotely). I look forward for your comments!

Here's just a bit of backstory, in case you are interested in how this doc came to be. The trajectory it followed is somewhat unusual.

  *   Despite OAuth2 not requiring any specific format for ATs, through the years I have come across multiple proprietary solution using JWT for their access token. The intent and scenarios addressed by those solutions are mostly the same across vendors, but the syntax and interpretations in the implementations are different enough to prevent developers from reusing code and skills when moving from product to product.
  *   I asked several individuals from key products and services to share with me concrete examples of their JWT access tokens (THANK YOU Dominick Baier (IdentityServer), Brian Campbell (PingIdentity), Daniel Dobalian (Microsoft), Karl Guinness (Okta) for the tokens and explanations!).
I studied and compared all those instances, identifying commonalities and differences.
  *   I put together a presentation summarizing my findings and suggesting a rough interoperable profile (slides: https://sec.uni-stuttgart.de/_media/events/osw2019/slides/bertocci_-_a_jwt_profile_for_ats.pptx<https://sec..uni-stuttgart.de/_media/events/osw2019/slides/bertocci_-_a_jwt_profile_for_ats.pptx> ) - got early feedback from Filip Skokan on it. Thx Filip!
  *   The presentation was followed up by 1.5 hours of unconference discussion, which was incredibly valuable to get tight-loop feedback and incorporate new ideas. John Bradley, Brian Campbell Vladimir Dzhuvinov, Torsten Lodderstedt, Nat Sakimura, Hannes Tschofenig were all there and contributed generously to the discussion. Thank you!!!
Note: if you were at OSW2019, participated in the discussion and didn't get credited in the draft, my apologies: please send me a note and I'll make things right at the next update.
  *   On my flight back I did my best to incorporate all the ideas and feedback in a draft, which will be discussed at IETF104 tomorrow. Rifaat, Hannes and above all Brian were all super helpful in negotiating the mysterious syntax of the RFC format and submission process.
I was blown away by the availability, involvement and willingness to invest time to get things right that everyone demonstrated in the process. This is an amazing community.
V.
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth

_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth


--
hans.zandbelt@zmartzone.eu<mailto:hans.zandbelt@zmartzone.eu>
ZmartZone IAM - www.zmartzone.eu<http://www.zmartzone.eu>


--
hans.zandbelt@zmartzone.eu<mailto:hans.zandbelt@zmartzone.eu>
ZmartZone IAM - www.zmartzone.eu<http://www.zmartzone.eu>
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth


--