<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">The intent behind the text "Note: "jwt.query" MUST NOT be used in conjunction with response types 
that contain "token" or "id_token" unless the response JWT is encrypted 
to prevent token leakage in the URL"  is to avoid leaking an access or ID token in the query string of the redirect URI.  So, based on that intent, returning an error response unencrypted with "jwt.query" would be okay. And a client that asked for "jwt.query" will be expecting the response to come back as a query parameter. So I'd say that If an error occurred during building the JWT in the case  in question, the error should be returned in the query part. <br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 27, 2018 at 9:44 PM Takahiko Kawasaki via Openid-specs-fapi <<a href="mailto:openid-specs-fapi@lists.openid.net">openid-specs-fapi@lists.openid.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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>
_______________________________________________<br>
Openid-specs-fapi mailing list<br>
<a href="mailto:Openid-specs-fapi@lists.openid.net" target="_blank">Openid-specs-fapi@lists.openid.net</a><br>
<a href="http://lists.openid.net/mailman/listinfo/openid-specs-fapi" rel="noreferrer" target="_blank">http://lists.openid.net/mailman/listinfo/openid-specs-fapi</a><br>
</blockquote></div>

<br>
<i style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;background:rgb(255,255,255);font-family:proxima-nova-zendesk,system-ui,-apple-system,system-ui,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif;color:rgb(85,85,85)"><span style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;background:transparent;font-family:proxima-nova-zendesk,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",Arial,sans-serif;font-weight:600"><font size="2">CONFIDENTIALITY NOTICE: This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by e-mail and delete the message and any file attachments from your computer. Thank you.</font></span></i>