[OAUTH-WG] Re: SD-JWT architecture feedback
Dick Hardt <dick.hardt@gmail.com> Sun, 22 September 2024 14:12 UTC
Return-Path: <dick.hardt@gmail.com>
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 82FE8C14F616 for <oauth@ietfa.amsl.com>; Sun, 22 Sep 2024 07:12:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.105
X-Spam-Level:
X-Spam-Status: No, score=-7.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4OZQTyQAABTo for <oauth@ietfa.amsl.com>; Sun, 22 Sep 2024 07:12:43 -0700 (PDT)
Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 58EC6C14F5F8 for <oauth@ietf.org>; Sun, 22 Sep 2024 07:12:43 -0700 (PDT)
Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-6ddd138e0d0so30653387b3.1 for <oauth@ietf.org>; Sun, 22 Sep 2024 07:12:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727014362; x=1727619162; darn=ietf.org; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=v6m4wD7ZUHhDLhT4qknUAYF+23CdUXfxJTGi22wDmGU=; b=gQnWsOZosh3MsQcRBVIeHlnb/K90vs5xxyrZMhWCouPsPg+9rOsVpt83p8T/ATSkM+ Gs2H1cr7X+wvaY4bNOe88XTkLy5+h19cZC4WqAwr8HUtBgv8GGfc7E0fiSyMofdREefW bW6FjCn8D0T7juoH/aDUKautz1Fw0ulMm0+XiJoW/H7zUBoCYEBwTrWpW05R+C/3f3Yw v0G1yPI83uW9U83/W6dMUzzy5LggD7hHzjMR7Cwxuhz3uiKHTUCmZ6fSIGbgefc5N+QT bjk6aBqPBaCxR8KtwbzRGkFl6IIodRahxGX3CwjyPxo8rQtJxNPNSNypW7hHhxYMho6R qfCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727014362; x=1727619162; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v6m4wD7ZUHhDLhT4qknUAYF+23CdUXfxJTGi22wDmGU=; b=HqCnbqCSMr3Dn9PymOUlzM4022GCm7qjVx7jGp1TRFgIupK1s1QwP39UqVdJpZZQSZ nzJl30hlzpgTuF1Oz9Yuy13ySj1ut2aP5ccM43SBCjV3O+YSNucC0rOAbs6u0glUdg0e JobXx0HXtd9BXnb1TSxQHTB/b+HulGO0voLnDjoUTTAJJNXCUrBvf/pU+QyHvSBOV72y 2b+tQ7pTJsX2BDb/s9KBlUcPam5/InaOPFs3Be6VlVNGqYyec/voErfhLxLtqQOvahco EikfKaxl2n2siiGk+wpXX/dUpkGQS8dI1MjkPFE6rYgkEhI+bRgDHWqBbODa2b024hD+ SbHg==
X-Gm-Message-State: AOJu0Ywvj9ri75FEFy5qlqGZu/+3PRMRuhd7g+R3ofQv7McLZPTBTMGb 3GC4WUugpJ1C84FpsD8Tl2LbqvCiWnfYGEdqHQzyzwGCYu5hVo4sWwUicVp06sKNr4QdzCYCIsM IfW5YoaV/9nUpEu+jrjFqovtPX8g=
X-Google-Smtp-Source: AGHT+IFgGw8XSDK2qeREktmDw3Hot5KUrpzES6BGb78YRo6cI7zJX3EHspi2yR2L0Ch0/3X3f657s/1G83xKc2EDeDQ=
X-Received: by 2002:a05:690c:6c04:b0:6ad:deb1:c8e0 with SMTP id 00721157ae682-6dfeed32d2dmr78469527b3.18.1727014362214; Sun, 22 Sep 2024 07:12:42 -0700 (PDT)
MIME-Version: 1.0
References: <CAD9ie-s9kricU8_VBBucQMob-n1jWN5xHd5Ymck=biUWqpH9yQ@mail.gmail.com> <e64eb21d-1ef4-4352-9c74-ffbb853ce3da@danielfett.de> <CAD9ie-t9jLMG5aROCR-EOuCYh19F2r67-C0Puw2OF4GEcvBc2g@mail.gmail.com>
In-Reply-To: <CAD9ie-t9jLMG5aROCR-EOuCYh19F2r67-C0Puw2OF4GEcvBc2g@mail.gmail.com>
From: Dick Hardt <dick.hardt@gmail.com>
Date: Sun, 22 Sep 2024 16:12:06 +0200
Message-ID: <CAD9ie-vFajfDR+k041Do1MgmdAtf=bfiCdoD6V2MOY5BbSEp8g@mail.gmail.com>
To: Daniel Fett <mail@danielfett.de>
Content-Type: multipart/alternative; boundary="00000000000094fdfd0622b5ddff"
Message-ID-Hash: LO5NVPQG2T5DDSBM7ZYSLRH6BEHATFIE
X-Message-ID-Hash: LO5NVPQG2T5DDSBM7ZYSLRH6BEHATFIE
X-MailFrom: dick.hardt@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-oauth.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: oauth@ietf.org, kristina@sfc.keio.ac.jp
X-Mailman-Version: 3.3.9rc4
Precedence: list
Reply-To: Dick.Hardt@gmail.com
Subject: [OAUTH-WG] Re: SD-JWT architecture feedback
List-Id: OAUTH WG <oauth.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/SrVQd0n2U4i02j5xBmdQog0ffLQ>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Owner: <mailto:oauth-owner@ietf.org>
List-Post: <mailto:oauth@ietf.org>
List-Subscribe: <mailto:oauth-join@ietf.org>
List-Unsubscribe: <mailto:oauth-leave@ietf.org>
I wrote this feedback right after I had written the reworded introduction, as I had just read over the full document. I appreciate that you don't want to change what you have done, but if there is going to be a change, now is the time. When I was leading the design of what became OAuth 2.0 (OAuth-WRAP) and JOSE (Simple Web Tokens) - our high order bit was ease of implementation and to learn from the implementation challenges in OAuth 1.0 and XML-DSIG respectively. I share the feedback below not to infer that your choices are wrong, but wearing my implementation hat (I spend half my time now writing production code) and pointing out areas that I found confusing and in my opinion need polish. While it may be frustrating, WG-LC is often the only time many people fully read a spec. Such is life. You are welcome to ignore my feedback of course and push it through. I'm happy to provide clarification on my feedback and engage in productive discussion -- I'm not interested in trying to convince any of you to change anything. /Dick On Sat, Sep 21, 2024 at 6:15 PM Dick Hardt <dick.hardt@gmail.com> wrote: > > > On Sat, Sep 21, 2024 at 4:28 PM Daniel Fett <mail@danielfett.de> wrote: > >> Hi Dick, >> Am 21.09.24 um 06:41 schrieb Dick Hardt: >> >> Hey Brian, Kristina, Daniel >> >> I appreciate you have been working on this for a while, and this feedback >> is last minute, and people have already working code that works with it -- >> so this is unlikely to be welcome feedback -- but in the spirit of wanting >> what is best long term, here it is. >> >> You are unfortunately correct - not only have we been working on this for >> a while now, we also discussed many of the points you list below already. >> Since not all of those discussions happened here on the mailing list, I'll >> link to the relevant Github issues where appropriate. >> >> >> *Token Separators* >> It is not clear to me why the disclosures are an arbitrary array of '~' >> separated items. It seems very odd to me as a developer. Why not have a 4th >> '.' separated string that is base64 URL encoded JSON array of the >> disclosures? The header includes the 'typ' so that a parser knows what all >> the following components are and how many there are. >> >> If you use a JSON array for the disclosures, you need to >> double-base64-url-encode all disclosures, needlessly increasing the size of >> the SD-JWT(-KB). Please read these issues: >> >> https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/36 >> >> https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/180 >> >> https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/37 >> > I realized after sending that each disclosure should be its own component > so it is easy to compute the digest. > I had to realize that myself as I thought about implementing ... it did > not come from reading the doc. > >> >> *Disclosure Format* >> On the format of the disclosures, the implicit semantics of the order of >> items in an array is a throwback to data formats of the last century. We >> are using JSON, let's have it be an object where we name each item. >> >> We had that in the beginning, but the consensus was that we don't want to >> increase the size by using named object properties. Short single-letter >> properties were considered as well, but didn't add much value over an array. >> > I disagree -- but not a big deal. > >> >> *Array Disclosure* >> Is this really needed? The only example I saw was for multiple >> citizenships. Would the issuer of an SD-JWT that contains a subject's >> citizenship not be the country who they are a citizen of? Why would another >> country be authoritative that the subject is a citizen of another country? >> In the example, it is hard to imagine a verifier trusting the US to say >> someone is a DE citizen, or vice versa. The array of age claims in example >> A.3 does not need the non intuitive '...' array mechanism. >> >> Yes, it is needed. First of all, SD-JWT can be used universally, not just >> for credentials. >> > I don't know what that sentence means. It is alluded to in the current > introduction, and makes no sense to me. Are you saying that an SD-JWT could > be used to selectively disclose claims that are not user identity claims? > Sure. > >> Second, even if used for credentials, there are many types of credentials >> where there is a use case for disclosing only some array values. Take an >> education credential as an example, where the holder may want to disclose >> only relevant courses and grades. You'll find more use cases in the >> examples in the appendix. >> >> A bit besides the point, but in the EU context we do in fact plan for >> credentials attesting other nationalities (and have good reasons to do so, >> here PID credentials derived from the eID card for EU citizens, see >> https://bmi.usercontent.opencode.de/eudi-wallet/eidas-2.0-architekturkonzept/functions/00-pid-issuance-and-presentation/#pid-contents >> for details). >> > I'm going to dig in on this point. SD-JWT is NOT taking a JSON array as > input. You have an array of digests and an array of disclosures. You can > have as many of the same property as you want like you are doing with the > age claims in the example. > > IE you can have a digests for "nationality"="DE" and for > "nationality"="US" and then have a disclosure for each one. No '...' magic > needed. > > > >> Taking this out would simplify implementations. >> >> Fluff -- are there features that, when removed, would not simplify >> implementations? >> > > I'll restate it more strongly, I think the array support will double the > effort for no real benefit since as noted above, you can already include > multiples of the same property in an SD-JWT > >> >> *Claim Names* >> Why do the claims start with '_'? Why not just 'sd' and 'sda'? Why is >> '_sd_alg' in the payload and not in the header? >> >> While the underscore doesn't officially have any special meaning, adding >> it reduces the chance for collisions with existing claims and makes the >> SD-JWT-related claims sort nicely. All SD-related claims are in the >> payload, that's why we put _sd_alg there as well. >> > Do you have data that shows it will reduce collisions? I have seen many > implementations that created their own claims that start with _ to reduce > collisions with the same rationale! > > There is an IANA registry for claim names to avoid collisions. > > The _ reminds me of internal C variables that others were not supposed to > use, but eventually did. > > _sd_alg is NOT a claim. It is a signal for which algorithm to use and > should be in the header. > > I'm unclear on the sorting advantage. They would sort together if they > started with sd as well. > > >> >> *Explicit Typing* >> Why leave the typing in the header to be determined by the application >> (10.11), and not just be 'sd-jwt' and be REQUIRED? >> >> We had extensive discussions around typing, please refer to the following >> issues: >> >> - https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/267 >> >> - https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/327 >> >> - https://github.com/oauth-wg/oauth-selective-disclosure-jwt/issues/345 >> > > Those issues don't really address the point. > > Per RFC 8725: JSON Web Token Best Current Practices (rfc-editor.org) > <https://www.rfc-editor.org/rfc/rfc8725.html#name-use-explicit-typing> -- > the best practice would be to have a single type that would allow a library > to know it is an SD-JWT. If additional context is needed, perhaps that > should be a different header property? > > >
- [OAUTH-WG] SD-JWT architecture feedback Dick Hardt
- [OAUTH-WG] Re: SD-JWT architecture feedback Warren Parad
- [OAUTH-WG] Re: SD-JWT architecture feedback Daniel Fett
- [OAUTH-WG] Re: SD-JWT architecture feedback Dick Hardt
- [OAUTH-WG] Leading underscores in SD-JWT Claim Na… Michael Jones
- [OAUTH-WG] Explicit typing of SD-JWTs (was SD-JWT… Michael Jones
- [OAUTH-WG] Re: Leading underscores in SD-JWT Clai… Dick Hardt
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Dick Hardt
- [OAUTH-WG] Re: Leading underscores in SD-JWT Clai… Rohan Mahy
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… David Waite
- [OAUTH-WG] Re: SD-JWT architecture feedback Rohan Mahy
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Rohan Mahy
- [OAUTH-WG] Re: SD-JWT architecture feedback Dick Hardt
- [OAUTH-WG] Re: Leading underscores in SD-JWT Clai… Brian Campbell
- [OAUTH-WG] Array Disclosure (was SD-JWT architect… Denis
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Kristina Yasuda
- [OAUTH-WG] Re: SD-JWT architecture feedback Brian Campbell
- [OAUTH-WG] Re: SD-JWT architecture feedback Dick Hardt
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Brian Campbell
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Dick Hardt
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Brian Campbell
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Dick Hardt
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Rohan Mahy
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Brian Campbell
- [OAUTH-WG] Re: Explicit typing of SD-JWTs (was SD… Dick Hardt