add redirect_uri to Credential Offer - #759
paulbastian wants to merge 16 commits into
Conversation
| * `authorization_code`: OPTIONAL. Object for the Authorization Code Grant type. | ||
| * `issuer_state`: OPTIONAL. String value created by the Credential Issuer and opaque to the Wallet that is used to bind the subsequent Authorization Request with a context set up during previous process steps. If the Wallet decides to use the Authorization Code Flow and received a value for this parameter, it MUST include it in the subsequent Authorization Request to the Authorization Server as the `issuer_state` parameter value. | ||
| * `authorization_server`: OPTIONAL string that the Wallet can use to identify the Authorization Server to use with this grant type when `authorization_servers` parameter in the Credential Issuer metadata has multiple entries. It MUST NOT be used otherwise. The value of this parameter MUST match with one of the values in the `authorization_servers` array obtained from the Credential Issuer metadata. | ||
| * `urn:ietf:params:oauth:grant-type:pre-authorized_code`: OPTIONAL. Object for the Pre-authorized Code Grant type. | ||
| * `pre-authorized_code`: REQUIRED. The code representing the Credential Issuer's authorization for the Wallet to obtain Credentials of a certain type. This code MUST be short lived and single use. If the Wallet decides to use the Pre-Authorized Code Flow, this parameter value MUST be included in the subsequent Token Request with the Pre-Authorized Code Flow. | ||
| * `tx_code`: OPTIONAL. Object indicating that a Transaction Code is required if present, even if empty. It describes the requirements for a Transaction Code, which the Authorization Server expects the End-User to present along with the Token Request in a Pre-Authorized Code Flow. If the Authorization Server does not expect a Transaction Code, this object is absent; this is the default. The Transaction Code is intended to bind the Pre-Authorized Code to a certain transaction to prevent replay of this code by an attacker that, for example, scanned the QR code while standing behind the legitimate End-User. It is RECOMMENDED to send the Transaction Code via a separate channel. If the Wallet decides to use the Pre-Authorized Code Flow, the Transaction Code value MUST be sent in the `tx_code` parameter with the respective Token Request as defined in (#token-request). If no `length`, `description`, or `input_mode` is given, this object MAY be empty. | ||
| * `input_mode` : OPTIONAL. String specifying the input character set. Possible values are `numeric` (only digits) and `text` (any characters). The default is `numeric`. | ||
| * `length`: OPTIONAL. Integer specifying the length of the Transaction Code. This helps the Wallet to render the input screen and improve the user experience. | ||
| * `description`: OPTIONAL. String containing guidance for the Holder of the Wallet on how to obtain the Transaction Code, e.g., describing over which communication channel it is delivered. The Wallet is RECOMMENDED to display this description next to the Transaction Code input screen to improve the user experience. The length of the string MUST NOT exceed 300 characters. The `description` does not support internationalization, however the Issuer MAY detect the Holder's language by previous communication or an HTTP Accept-Language header within an HTTP GET request for a Credential Offer URI. | ||
| * `authorization_server`: OPTIONAL string that the Wallet can use to identify the Authorization Server to use with this grant type when `authorization_servers` parameter in the Credential Issuer metadata has multiple entries. It MUST NOT be used otherwise. The value of this parameter MUST match with one of the values in the `authorization_servers` array obtained from the Credential Issuer metadata. |
There was a problem hiding this comment.
for reviews: this part is only moved upwards
Co-authored-by: Gareth Oliver <gco@google.com>
|
|
||
| Additional Credential Offer parameters MAY be defined and used. | ||
| The Wallet MUST ignore any unrecognized parameters. | ||
|
|
There was a problem hiding this comment.
these editorial changes move these two lines further down, which currently split the grants parameter from the grants values
| } | ||
| } | ||
| }, | ||
| "redirect_uri": "https://credential-issuer.example.com/return?issuer_state=eyJhbGciOiJSU0Et...FYUaBy" |
There was a problem hiding this comment.
This makes me feel uneasy. If issuer_state is likely to be something important here, it feels like we should guarantee that the issuer_state passed to the redirect_uri is the one that was used in this session? (i.e. that it hasn't been switched out by an attacker.)
There was a problem hiding this comment.
Does it help to remove the issuer_state query parameter?
There was a problem hiding this comment.
I remove the query parameter
Co-authored-by: Paul Bastian <paul.bastian@posteo.de>
Co-authored-by: Joseph Heenan <joseph@authlete.com>
c2bo
left a comment
There was a problem hiding this comment.
Small nit/proposal and I am wondering if calling it redirect_uri which directly clashes with OAuth naming is helpful or harmful. Maybe we should call it something like issuer_return_uri instead?
Looks good to me otherwise.
| * `length`: OPTIONAL. Integer specifying the length of the Transaction Code. This helps the Wallet to render the input screen and improve the user experience. | ||
| * `description`: OPTIONAL. String containing guidance for the Holder of the Wallet on how to obtain the Transaction Code, e.g., describing over which communication channel it is delivered. The Wallet is RECOMMENDED to display this description next to the Transaction Code input screen to improve the user experience. The length of the string MUST NOT exceed 300 characters. The `description` does not support internationalization, however the Issuer MAY detect the Holder's language by previous communication or an HTTP Accept-Language header within an HTTP GET request for a Credential Offer URI. | ||
| * `authorization_server`: OPTIONAL string that the Wallet can use to identify the Authorization Server to use with this grant type when `authorization_servers` parameter in the Credential Issuer metadata has multiple entries. It MUST NOT be used otherwise. The value of this parameter MUST match with one of the values in the `authorization_servers` array obtained from the Credential Issuer metadata. | ||
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after it has finished processing the Credential Offer, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. |
There was a problem hiding this comment.
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after it has finished processing the Credential Offer, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. | |
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after the issuance flow initiated by the Credential Offer has concluded, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. |
There was a problem hiding this comment.
Agree with Christian's suggestion, I think the 'User Agent of the Wallet's device' is still ambiguous though - I would guess some implementations might still interpret that as allowing an in-app browser tab, and I'm not sure if that's a good thing.
Here's Christian's suggestion incorporating Frederik's previous suggestion as well:
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after it has finished processing the Credential Offer, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. | |
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate a User Agent to this URL once the issuance flow initiated by the Credential Offer has concluded, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this in all cases, including where issuance succeeded, failed, was canceled or entered a deferred state. The Credential Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST NOT use this value unless it validates against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters); see (#redirect-security). |
I agree with Christian - I think using a different name would really help avoid confusing, having two redirect_uris (the oauth one and this new one) in the same flow sounds like something best avoided. |
|
Discussed today, no opposition in group to the change suggested here: #759 (review) |
|
I thought a bit about @jogu's comments during today's WG call. I believe the usual OAuth risk of Alternative solution: Rename the expected_redirect_origins parameter to something else and allow it to carry both, origins and URIs -> deployments can choose to use either an origin or full URLs. That gives deployments the freedom to adjust this to their deployment reality and should be reasonably easy to implement on the Wallet side: if the string contains path/query values, treat it as a strict URL match, otherwise compare prefix (origin). |
|
|
||
| ## Redirect to the Credential Issuer {#redirect-security} | ||
|
|
||
| The `expected_redirect_origins` Credential Issuer metadata parameter allows the Wallet to authenticate the origin of the `redirect_uri`. An attacker that is able to modify a Credential Offer, as described in (#credential-offer-security), can therefore manipulate the path, query, and fragment components under a listed origin. Credential Issuers therefore SHOULD only list origins whose content they fully control. In multi-tenant environments, this is achieved by hosting each tenant on its own subdomain, so that every tenant has a distinct origin, and by listing only that tenant's origin in `expected_redirect_origins`. Credential Issuers that cannot separate origins in this way and that are concerned about phishing attacks SHOULD NOT use the `redirect_uri` Credential Offer parameter. |
There was a problem hiding this comment.
This feels like we're still leaving a foot gun there - is there really a clear use case that means (for example) we couldn't like URLs and require everything except the url query to match?
There was a problem hiding this comment.
Paul and I discussed a bit:
I understand his reason for using origins is that it can be troublesome to get paths in the .well-known updated when the expected redirect uris need to change.
I still think that allowing a redirect to anywhere opens the possibility for some phishing attacks - e.g. as an attack I send a credential offer issues a credential to the user, then redirects to somewhere on a massive website that ends up suggesting the user presents their new credential to an attacker controlled site to "prove your credential works" or "see how the flow works".
It feels to me like the same set of people that have trouble updating origins in .well-known has some overlap with the set of people that will have huge websites where that potential for user generated content is there.
It's definitely a trade off. I think I'm still feeling like the better option is to force the security on people, meaning they end up having to either get the .well-known updated, or spin up a subdomain (the latter being what we're basically recommending anyway). My fear is without that people will cut corners ("it's only a should, we can ignore it as it's difficult for us").
|
|
||
| The Credential Issuer MUST ensure the release of any privacy-sensitive data in Credential Offer is legal. | ||
|
|
||
| ## Redirect to the Credential Issuer {#redirect-security} |
There was a problem hiding this comment.
I think we need an additional section pointing out that the content of the redirect_uri (or issuer_return_uri) are basically untrusted and that the issuer might want to try and correlate them with a session or otherwise validate they're applicable to the user viewing the page before doing too much with any returned values.
perhaps something like:
Credential Issuers MUST NOT rely on data conveyed in the
redirect_uri, to identify or authenticate the session in which the Credential Offer was issued, as an attacker that modified the Credential Offer controls those values.
| ## Redirect to the Credential Issuer {#redirect-security} | ||
|
|
||
| The `expected_redirect_origins` Credential Issuer metadata parameter allows the Wallet to authenticate the origin of the `redirect_uri`. An attacker that is able to modify a Credential Offer, as described in (#credential-offer-security), can therefore manipulate the path, query, and fragment components under a listed origin. Credential Issuers therefore SHOULD only list origins whose content they fully control. In multi-tenant environments, this is achieved by hosting each tenant on its own subdomain, so that every tenant has a distinct origin, and by listing only that tenant's origin in `expected_redirect_origins`. Credential Issuers that cannot separate origins in this way and that are concerned about phishing attacks SHOULD NOT use the `redirect_uri` Credential Offer parameter. | ||
|
|
There was a problem hiding this comment.
I think we should add to the text in privacy considerations to, not disimmilar to the text we already have about the oauth redirect url.
| * `length`: OPTIONAL. Integer specifying the length of the Transaction Code. This helps the Wallet to render the input screen and improve the user experience. | ||
| * `description`: OPTIONAL. String containing guidance for the Holder of the Wallet on how to obtain the Transaction Code, e.g., describing over which communication channel it is delivered. The Wallet is RECOMMENDED to display this description next to the Transaction Code input screen to improve the user experience. The length of the string MUST NOT exceed 300 characters. The `description` does not support internationalization, however the Issuer MAY detect the Holder's language by previous communication or an HTTP Accept-Language header within an HTTP GET request for a Credential Offer URI. | ||
| * `authorization_server`: OPTIONAL string that the Wallet can use to identify the Authorization Server to use with this grant type when `authorization_servers` parameter in the Credential Issuer metadata has multiple entries. It MUST NOT be used otherwise. The value of this parameter MUST match with one of the values in the `authorization_servers` array obtained from the Credential Issuer metadata. | ||
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after it has finished processing the Credential Offer, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. |
There was a problem hiding this comment.
Agree with Christian's suggestion, I think the 'User Agent of the Wallet's device' is still ambiguous though - I would guess some implementations might still interpret that as allowing an in-app browser tab, and I'm not sure if that's a good thing.
Here's Christian's suggestion incorporating Frederik's previous suggestion as well:
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate the User Agent of the Wallet's device to this URL after it has finished processing the Credential Offer, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this regardless of whether the issuance succeeded, failed, was canceled or entered deferred state. The Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore the `redirect_uri` if the validation fails. | |
| * `redirect_uri`: OPTIONAL. String that is a URL using the `https` scheme. If present, the Wallet SHOULD navigate a User Agent to this URL once the issuance flow initiated by the Credential Offer has concluded, e.g. to return to the Credential Issuer's website. The Wallet SHOULD do this in all cases, including where issuance succeeded, failed, was canceled or entered a deferred state. The Credential Issuer MUST NOT rely on the redirect occurring. The Wallet MAY ask the End-User for consent before navigating. Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST NOT use this value unless it validates against the `expected_redirect_origins` Credential Issuer metadata parameter as defined in (#credential-issuer-parameters); see (#redirect-security). |
| * `nonce_endpoint`: OPTIONAL. URL of the Credential Issuer's Nonce Endpoint, as defined in (#nonce-endpoint). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not require the use of `c_nonce`. | ||
| * `deferred_credential_endpoint`: OPTIONAL. URL of the Credential Issuer's Deferred Credential Endpoint, as defined in (#deferred-credential-issuance). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not support the Deferred Credential Endpoint. | ||
| * `notification_endpoint`: OPTIONAL. URL of the Credential Issuer's Notification Endpoint, as defined in (#notification-endpoint). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not support the Notification Endpoint. | ||
| * `expected_redirect_origins`: REQUIRED if the Credential Issuer uses the `redirect_uri` Credential Offer parameter (#credential-offer-parameters), and otherwise omitted. A non-empty array of strings, where each string is an origin, as defined in [@!RFC6454], that the Credential Issuer may use in the `redirect_uri` of the Credential Offer. If a Credential Offer contains a `redirect_uri`, the Wallet MUST NOT utilize it unless the origin of the `redirect_uri` matches one of the values in this array. If this parameter is omitted, the Wallet MUST ignore any `redirect_uri` present in a Credential Offer from this Credential Issuer. |
There was a problem hiding this comment.
The 'MUST NOT utilize' here duplicates the MUST in the parameter definition:
Because the Credential Offer is not authenticated (see (#credential-offer-security)), the Wallet MUST validate this value against the
expected_redirect_originsCredential Issuer metadata parameter as defined in (#credential-issuer-parameters) and MUST ignore theredirect_uriif the validation fails.
I'd suggest removing the MUST here and referring to the normative text in the parameter definition.
| (1a) The Wallet-initiated flow begins as the End-User requests a Credential via the Wallet from the Credential Issuer. The End-User either selects a Credential from a pre-configured list of Credentials ready to be issued, or alternatively, the Wallet gives guidance to the End-User to select a Credential from a Credential Issuer based on the information it received in the presentation request from a Verifier. | ||
|
|
||
| (1b) The Issuer-initiated flow begins as the Credential Issuer generates a Credential Offer for certain Credential(s) that it communicates to the Wallet, for example, as a QR code or as a URI. The Credential Offer contains the Credential Issuer's URL and the information about the Credential(s) being offered. This step is defined in (#credential-offer). | ||
| (1b) The Issuer-initiated flow begins as the Credential Issuer generates a Credential Offer for certain Credential(s) that it communicates to the Wallet, for example, as a QR code or as a URI. The Credential Offer contains the Credential Issuer's URL, information about the Credential(s) being offered and an optional Redirect URL. This step is defined in (#credential-offer). |
There was a problem hiding this comment.
If we're going to capitalise 'Redirect URL' it should be added to the defined terms section.
| * `nonce_endpoint`: OPTIONAL. URL of the Credential Issuer's Nonce Endpoint, as defined in (#nonce-endpoint). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not require the use of `c_nonce`. | ||
| * `deferred_credential_endpoint`: OPTIONAL. URL of the Credential Issuer's Deferred Credential Endpoint, as defined in (#deferred-credential-issuance). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not support the Deferred Credential Endpoint. | ||
| * `notification_endpoint`: OPTIONAL. URL of the Credential Issuer's Notification Endpoint, as defined in (#notification-endpoint). This URL MUST use the `https` scheme and MAY contain port, path, and query parameter components. If omitted, the Credential Issuer does not support the Notification Endpoint. | ||
| * `expected_redirect_origins`: REQUIRED if the Credential Issuer uses the `redirect_uri` Credential Offer parameter (#credential-offer-parameters), and otherwise omitted. A non-empty array of strings, where each string is an origin, as defined in [@!RFC6454], that the Credential Issuer may use in the `redirect_uri` of the Credential Offer. If a Credential Offer contains a `redirect_uri`, the Wallet MUST NOT utilize it unless the origin of the `redirect_uri` matches one of the values in this array. If this parameter is omitted, the Wallet MUST ignore any `redirect_uri` present in a Credential Offer from this Credential Issuer. |
There was a problem hiding this comment.
Somewhere we should probably say the matching is done as per https://www.rfc-editor.org/info/rfc6454/#section-5
|
Discussed in meeting, @paulbastian will address open comments |
Replaces #723