Open frankhinek opened 3 weeks ago
I love that we have YC to go through this flow, which in turn provokes these important changes. My thoughts to your unanswered questions:
Yes, we should for exactly the reasons you mentioned. We want to avoid implementation issues and reduce the number of decisions implementers need to make to ensure this is as simple for them as possible. Additionally, we should be showcasing the safest way of doing things. Since the current method of sending the Auth Request as JSON means it can be tampered with, we shouldn't be advising this approach.
I think we should support the authorization request by reference in addition to, not instead of, by value. That way we have that flexibility there for them to decide and I don't see the harm in having both approaches.
Once we all reach a conclusion on this, I'll be sure to update the KCC guides.
I agree. The raw JSON option is equivalent to request by value, but without signing.
I don't see much of a use case for request-by-reference, because the wallet has just made a GET request and expects a response. However, I'm comfortable adding it in addition to by-value. In general I think we shouldn't restrict what SIOPv2 allows without good reason.
Good catch, I glossed over this in the first go at kcc-prototype-exemplar.
response_uri
which I guess I could imagine a situation, especially in the enterprise world, where that alone could blow up to something like 1k bytes. So yeah, in favor of adding in-addition-to; definitely a case of solution without a known problem but existing use case > 50% seems a reasonable threshold to get in front of.given that HAIP requires request_uri
I believe we should as well - let's remove optionality where we can
HAIP is not a spec we've used in KCC so far. We aren't doing most of what it requires: SD-JWT VC, authorization code flow, sender-constrained tokens, S256 code challenge method. If we're going to take it's recommendations then it should be all of them.
I'm fine with using just 1 of request
or request_uri
though. I think request_uri
is the more flexible of the 2
If we're going to take it's recommendations then it should be all of them.
We should understand the choices they've made and why, and apply them where they make sense.
A few clear security benefits for using request_uri
:
We reduce the risk of an unsigned request by value (yes, we can prohibit this, but still a risk).
Even if the request parameter is signed, the authorization request parameters are still exposed in the URL when using request. This could lead to sensitive info like client_id
leaking to the User Agent -- browser histories, server logs, referrer headers, etc. request_uri
keeps the request parameters completely out of URLs.
The HAIP spec requires the use of Pushed Authorization Requests (PAR), which works well with request_uri
. The client can directly push the request object to the Auth Server using PAR, and then use the returned request_uri
in the authorization request.
I wasn't too familiar with PAR, but I believe it could be a good security addition to the KCC spec. This would improve the security of Step 3 in the Initiate Application Flow, so instead of
PFI URI-encodes SIOPv2 Authorization Request and returns in HTTP response
We could introduce a PAR endpoint which surfaces a request_uri
(instead of the current response_uri
) for the client to send the SIOPv2 Auth Response to. This would make sure the request parameters are never exposed to any intermediaries, since they're removed from the URI itself. Even if the request_uri
is intercepted it is meaningless without access to the PAR endpoint.
So tl;dr -- yes let's go with request_uri
, and let's consider using PAR.
I wasn't too familiar with PAR, but I believe it could be a good security addition to the KCC spec. This would improve the security of Step 3 in the Initiate Application Flow, so instead of
PFI URI-encodes SIOPv2 Authorization Request and returns in HTTP response
We could introduce a PAR endpoint which surfaces a
request_uri
(instead of the currentresponse_uri
) for the client to send the SIOPv2 Auth Response to. This would make sure the request parameters are never exposed to any intermediaries, since they're removed from the URI itself. Even if therequest_uri
is intercepted it is meaningless without access to the PAR endpoint.So tl;dr -- yes let's go with
request_uri
, and let's consider using PAR.
@decentralgabe I might have misread the spec, but I believe the issue is that this PAR cannot be easily combined with SIOPv2, particularly in cross-device scenarios.
As noted in the diagram below (excerpt from KCC README) the RP is the PFI and the IDP/Authorization Server is the mobile app. In order to use PAR, the mobile app would need a publicly accessible endpoint for the PFI to push its authorization request to. I've searched and thus far I can't find any good example of SIOPv2 combined with PAR when the IDP/AS doesn't have publicly accessible endpoints.
I'm
sequenceDiagram
autonumber
participant W as Webview
participant D as Mobile App
participant P as PFI
D->>+P: GET
P->>P: Construct SIOPv2 Authorization Request
P-->>-D: SIOPv2 Authorization Request
D->>D: Construct SIOPv2 Authorization Response
D->>+P: SIOPv2 Authorization Response
P->>P: Construct IDV Request
P-->>-D: IDV Request
D->>D: Verify IDV Request
D->>W: Load URL in IDV Request
my mistake - let's ignore my suggestion for PAR
JAR update PR for KCC-wallet
and KCC-issuer
guides. I have a question on there for y'all -thanks!
Context
@ethan-tbd and I were troubleshooting an issue with DIDPay throwing an exception during the KCC issuance sequence with the YC PFI.
DIDPay expects to receive a JWT-Secured Authorization Request (JAR):
Here's an example of what DIDPay expects to receive:
YC followed the kcc-prototype-exemplar so their endpoint is returning the JSON payload directly:
Proposal
We should:
Unanswered Questions
Should we make JWT-Secured Authorization Request (JAR) mandatory such that URL-encoded JSON auth requests are rejected? It seems like this is the most reasonable approach both to reduce variability / decisions for implementers and because accepting JSON means that the Auth Request from the RP (PFI Issuer in this case) is unsigned and could be tampered with. FWIW, although we don't use this spec due to its lack of support for DIDs, HAIP also mandates usage of RFC 9101 JARs for auth requests.
Should we enable support for returning the authorization request by reference in addition to (or instead of) by value? The benefit to doing this is that it makes it feasible (fewer bytes to QR encode a URI vs. signed JWT) to present the auth request as a QR code, which could then be scanned by a mobile device in the case that the wallet that contains the user's DID+keys+VCs are a different device from the one they are using to interact with a PFI. In other words, should we return an authorization request that looks like this: