Re: [jose] RFC-7517 section 4.5

Neil Madden <> Tue, 07 January 2020 13:31 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 1E1C7120100 for <>; Tue, 7 Jan 2020 05:31:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id kHVdvCw6Psef for <>; Tue, 7 Jan 2020 05:31:55 -0800 (PST)
Received: from ( [IPv6:2a00:1450:4864:20::436]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 98D261200E9 for <>; Tue, 7 Jan 2020 05:31:54 -0800 (PST)
Received: by with SMTP id b6so53994497wrq.0 for <>; Tue, 07 Jan 2020 05:31:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=wOQEs6nmrWuC3IitGGV8DrsMfGrDT5+jKxozNyV6N3g=; b=JU+PQSB5ryK3IfG5sSLrPOGHmVQZG+SuHMX/mnYDh0SZEQSLSO7RainJ0VtnnT0Rvb P9UMxwhWCV8Ou05V7Gw8E4atkqt/gCZ8otmCKUhCulJxfj+hrqzOM6pk5tnhBImwpHWL F8UdEn1Tsw31y7A6RsVQW2cWIPUCc7iGYWbuw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=wOQEs6nmrWuC3IitGGV8DrsMfGrDT5+jKxozNyV6N3g=; b=c6OhUIEFrdIwbOPCkkgWeUYgPE4oNHOzg8HTwNgSmGIIzlZsO0yga3BjGXSayV2lQg cQk+gms5ZIQiG4xZ5pTJQgG/h2tJRds/sjoo3gnT/K/IS2qGx4npQaHWSRGPWn1g3L4I B26w5bzL6Wir0+rONkm7+SXSGN2E0iDxyn/WajOAO9NoMyl7LBGWBTHSfqfqPFOjjmeJ IFJr0W7woUvEFvoth8rJy6v72iCSQggCHqa7E1SWByF8xuSUycN2W+1OqjtJ5brSiJXS YrQhOQwW1GFKjHXL14qwQ2+4Z7FGJfTwVUIpmjPhO9Ov7WA/eXQMRdUJbGN6Fijl6Ylg Zj4A==
X-Gm-Message-State: APjAAAXFW88GyyLN45kOAg1vo5VHl+KOyYtyxfInFpufeEYTCrO8J4QL /23K3RNELWOslVQFrpNo7RwjYjnus3ihEA==
X-Google-Smtp-Source: APXvYqx5aDs2ATTQPNa9bIozoguWqBpm9eNIwDB+IQFcipExKFQ0fc5NNKadyz85KvRM5lc/D+zG7w==
X-Received: by 2002:adf:f6c1:: with SMTP id y1mr117390214wrp.17.1578403913092; Tue, 07 Jan 2020 05:31:53 -0800 (PST)
Received: from [] ( []) by with ESMTPSA id p26sm26288409wmc.24.2020. (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jan 2020 05:31:52 -0800 (PST)
From: Neil Madden <>
Message-Id: <>
Content-Type: multipart/alternative; boundary="Apple-Mail=_95C998A9-39EE-48FB-A62D-D143C48ED696"
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\))
Date: Tue, 7 Jan 2020 13:31:50 +0000
In-Reply-To: <>
To: Ricardo Pereira <>
References: <>
X-Mailer: Apple Mail (2.3601.0.10)
Archived-At: <>
Subject: Re: [jose] RFC-7517 section 4.5
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Javascript Object Signing and Encryption <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 07 Jan 2020 13:31:57 -0000

As per the language in the RFC this is only a SHOULD (not a MUST) so the publisher of the JWK Set is free to publish keys with duplicate "kid" values. A robust client library needs to be able to handle this case as it clearly does occur in the wild. Our (ForgeRock's) authorization server has also done this in the past (publishing the same key with different "use" or "alg" values, for example).

-- Neil

> On 7 Jan 2020, at 10:46, Ricardo Pereira <> wrote:
> Hello,
> I have a question regarding the section 4.5 of the RFC-7517 which states:
> 4.5 <>.  "kid" (Key ID) Parameter
>    The "kid" (key ID) parameter is used to match a specific key.  This
>    is used, for instance, to choose among a set of keys within a JWK Set
>    during key rollover.  The structure of the "kid" value is
>    unspecified.  When "kid" values are used within a JWK Set, different
>    keys within the JWK Set SHOULD use distinct "kid" values.  (One
>    example in which different keys might use the same "kid" value is if
>    they have different "kty" (key type) values but are considered to be
>    equivalent alternatives by the application using them.)  The "kid"
>    value is a case-sensitive string.  Use of this member is OPTIONAL.
>    When used with JWS or JWE, the "kid" value is used to match a JWS or
>    JWE "kid" Header Parameter value.
> The part which is raising concerns is:
> When "kid" values are used within a JWK Set, different keys within the JWK Set SHOULD use distinct "kid" values.
> Context:
> I am using an openid certified node library which does not allow for multiple keys with the same ID.
> An issue <> has been opened (and closed) where the author/maintainer states that the keys should have different kids and the problem is with the issuer.
> The issuer (based on identity server 4) which I connect to states the opposite.. That the offending keys (the repeating ones) are not different keys but the same and, as such, can use the same kid.
> Question:
> Which party is correct?
> Thank you for your time,
> Ricardo Pereira
> _______________________________________________
> jose mailing list