<div dir="ltr"><div><div>I find the text around azp and aud to be rather unclear and I think there's a potential item for errata in it somewhere.<br><br></div>From the definition of <a href="http://tools.ietf.org/html/rfc7519#section-4.1.3">"aud" in JWT</a> and its use in <a href="http://openid.net/specs/openid-connect-core-1_0.html#IDToken">Connect's ID Token</a> (relevant spec text is copied below), it seems that that the client id of the client/RP that made the authentication request has to be one of the values, or the only value, of the "aud" claim in the ID Token. That's logical and consistent and provides reliable and interoperable guidance to implementers about producing and consuming the ID Token. I think that the client id of the RP/client that made the authentication request should always be represented in the aud of the returned ID Token. <br><br></div>The text around "azp" in the <a href="http://openid.net/specs/openid-connect-core-1_0.html#IDToken">ID Token section</a> and the <a href=" http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation">ID Token Validation section</a> seems to maybe suggest something different, however. Like perhaps that the client id of the RP/client that made the authentication request could, in some totally unspecified circumstance, be the value of the azp claim and that the aud would not identify that client as an intended recipient. Am I misinterpreting things? I hope so because that seems like it'd be fragile from an interop perspective and is certainly more cumbersome for general JWT libraries to support. <br><br><div><br><div><div><div><br>from <a href="http://tools.ietf.org/html/rfc7519#section-4.1.3">http://tools.ietf.org/html/rfc7519#section-4.1.3</a><br><br> 4.1.3.  "aud" (Audience) Claim<br><br>   The "aud" (audience) claim identifies the recipients that the JWT is<br>   intended for.  Each principal intended to process the JWT MUST<br>   identify itself with a value in the audience claim.  If the principal<br>   processing the claim does not identify itself with a value in the<br>   "aud" claim when this claim is present, then the JWT MUST be<br>   rejected.  In the general case, the "aud" value is an array of case-<br>   sensitive strings, each containing a StringOrURI value.  In the<br>   special case when the JWT has one audience, the "aud" value MAY be a<br>   single case-sensitive string containing a StringOrURI value.  The<br>   interpretation of audience values is generally application specific.<br>   Use of this claim is OPTIONAL.<br><br><br>from <a href="http://openid.net/specs/openid-connect-core-1_0.html#IDToken">http://openid.net/specs/openid-connect-core-1_0.html#IDToken</a><br><dl><dt>  ...  <br></dt><dt>  aud</dt><dd>
            
            REQUIRED.
            Audience(s) that this ID Token is intended for.
            It MUST contain the OAuth 2.0 <tt>client_id</tt>
            of the Relying Party as an audience value.
            It MAY also contain identifiers for other audiences.
            In the general case,
            the <tt>aud</tt> value is an array of
            case sensitive strings.
            In the common special case when there is one audience,
            the <tt>aud</tt> value MAY be a single
            case sensitive string.
          
</dd></dl><p>  ...<br></p><dl><dt>  azp</dt><dd>
            
            OPTIONAL.
            Authorized party - the party to which the ID Token was issued.
            If present, it MUST contain the OAuth 2.0
            Client ID of this party.
            This Claim is only needed when
            the ID Token has a single audience value
            and that audience is different than the authorized party.
            It MAY be included even when the authorized party is the same
            as the sole audience.
            The <tt>azp</tt> value is a case sensitive string
            containing a StringOrURI value.
          
</dd></dl>  ...<br><br>from <a href="http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation">http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation</a><br><br>  Clients MUST validate the ID Token in the Token Response
              in the following manner:
            
<br><br><div style="margin-left:40px">...<br>4. If the ID Token contains multiple audiences, the Client SHOULD verify that an azp Claim is present.<br>...<br>5. If an azp (authorized party) Claim is present, the Client SHOULD verify that its client_id is the Claim Value.<br>...<br>8 If the JWT alg Header Parameter uses a MAC based algorithm such as HS256, HS384, or HS512, the octets of the UTF-8 representation of the client_secret corresponding to the client_id contained in the aud (audience) Claim are used as the key to validate the signature. For MAC based algorithms, the behavior is unspecified if the aud is multi-valued or if an azp value is present that is different than the aud value.<br>The current time MUST be before the time represented by the exp Claim. <br><br><br><br><br></div></div></div></div></div></div>