<div dir="ltr"><div dir="ltr">Hello,<div><br></div><div><div><a href="https://openid.net/specs/openid-financial-api-jarm.html#response-mode-query.jwt">4.3.1. Response Mode "query.jwt"</a> says as follows:</div><div><br></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div dir="ltr"><div><div><i>Note: "query.jwt" MUST NOT be used in conjunction with response types that contain "token" or "id_token" <b>unless the response JWT is encrypted</b> to prevent token leakage in the URL.</i></div></div></div></blockquote><div dir="ltr"><div><br></div><div>This implies that, if the JWT is encrypted, "query.jwt" can be used even if the default response mode of the response type is "fragment". This can happen, for example, when an authorization request includes "response_type=id_token&response_mode=query.jwt" and the "authorization_encrypted_response_alg" metadata of the client is set.</div><div><br></div><div>If an error occurred during building the JWT in the case above, how should the error be reported? Should the response parameters ("error", "error_description", "error_uri", "state") be embedded in the query part or in the fragment part?</div><div><br></div><div>IMHO, in this case, "fragment" should be chosen as the fallback response mode. The following is a pseudocode.</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// Special case. If the response mode is "query.jwt" although the</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// default response mode of the response type is "fragment", it</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// means that "query.jwt" was allowed on the assumption that the</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// JWT would be encrypted. This happens when the response_mode</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// request parameter of the authorization request is "query.jwt"</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// and the 'authorization_encrypted_response_alg' metadata of the</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// client is set.</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">//</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// Because an authorization response JWT failed to be created and</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// so the response parameters won't be encrypted, the query part</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// should not be used. Therefore, in this case, "query.jwt" is</font></div></div><div><div><font face="monospace, monospace" size="1" color="#6aa84f">// converted not to "query" but to "fragment".</font></div></div><div><div><font face="monospace, monospace" size="1">if (<font color="#0000ff">mResponseMode</font> == ResponseMode.<font color="#0000ff">QUERY_JWT</font> &&</font></div></div><div><div><font face="monospace, monospace" size="1">    <font color="#0000ff">mResponseType</font>.requiresImplicitFlow())</font></div></div><div><div><font face="monospace, monospace" size="1">{</font></div></div><div><div><font face="monospace, monospace" size="1">    <font color="#6aa84f">// Change "query.jwt" to "fragment".</font></font></div></div><div><div><font face="monospace, monospace" size="1">    <font color="#0000ff">mResponseMode</font> = ResponseMode.<font color="#0000ff">FRAGMENT</font>;</font></div></div><div><div><font face="monospace, monospace" size="1">}</font></div></div><div><div><font face="monospace, monospace" size="1">else</font></div></div><div><div><font face="monospace, monospace" size="1">{</font></div></div><div><div><font face="monospace, monospace" size="1">    <font color="#6aa84f">// Change "{???}.jwt" to "{???}".</font></font></div></div><div><div><font face="monospace, monospace" size="1">    <font color="#0000ff">mResponseMode</font> = <font color="#0000ff">mResponseMode</font>.withoutJwt();</font></div></div><div><div><font face="monospace, monospace" size="1">}</font></div></div></blockquote><div dir="ltr"><div><br></div><div>This is implementable (and actually I have implemented the logic), but I'm not sure all implementers will reach the same conclusion and I'm afraid this will harm interoperability.</div><div><br></div><div>This complexity is introduced by the condition, <i>"unless the response JWT is encrypted"</i>. I think there are two options.</div><div><br></div><div><ol><li>Remove the condition and state that "query.jwt" should not be used when the default response mode of the response type is not "query" even if the JWT is encrypted.<br></li><li>Keep the condition and describe in detail how the error case should be handled.<br></li></ol></div><div><br></div><div>Do you have any thought?</div><div><br></div><div><br></div><div>Best Regards,</div><div>Takahiko Kawasaki</div><div>Authlete, Inc.</div><div><br></div></div></div>