@@ -74,7 +74,8 @@ The name, or the fingerprint of an unnamed token, is also who owns the credentia
7474owner, by design: a token can be rotated without losing its offers, and an offering system and a support system can
7575share their offers by sharing a name. Two integrations an operator gives the same name share them too, so give each
7676integration a name of its own. An unnamed token owns its offers by its fingerprint, so rotating it loses them: the
77- new token can neither list them nor change the status of what they issued (the administration screens still can).
77+ new token can neither list nor withdraw them, nor change the status of what they issued (the administration screens
78+ still reach those credentials).
7879
7980### Limiting a token to credential configurations
8081
@@ -178,8 +179,9 @@ The response is a JSON object with two fields:
178179* __ credential_offer_uri__ (string): the credential offer URI, which the wallet is sent to.
179180* __ offer_id__ (string): the identifier of the offer, 64 lower-case hexadecimal characters. Keep it: it is how the
180181caller later asks which credentials the offer produced, and changes their status (see
181- [ Credential Offer Details] ( #credential-offer-details ) ). It is neither the pre-authorized code nor the issuer state,
182- which redeem the offer and are for the wallet only, so it can go into the caller's own records and logs.
182+ [ Credential Offer Details] ( #credential-offer-details ) ), and how it withdraws the offer (see
183+ [ Credential Offer Withdrawal] ( #credential-offer-withdrawal ) ). It is neither the pre-authorized code nor the issuer
184+ state, which redeem the offer and are for the wallet only, so it can go into the caller's own records and logs.
183185
184186Every offer is recorded, with the principal of the token which made it as its owner (its name, or a fingerprint;
185187see [ Naming a token] ( #naming-a-token ) ). An offer made from an administrator's session, or from the administration
@@ -287,7 +289,8 @@ Response:
287289
288290Tells the caller which made a credential offer what the offer produced: the offer as it is recorded, and the
289291credentials issued from it, each with the identifier the [ Credential Status] ( #credential-status ) endpoint takes.
290- Withdrawing a credential issued from an offer is then: list the offer's credentials, and change the status of each.
292+ Revoking everything an offer issued is then: [ withdraw the offer] ( #credential-offer-withdrawal ) , so that it issues
293+ nothing more, list its credentials, and change the status of each.
291294
292295It is served under the same settings as the [ Credential Offer] ( #credential-offer ) endpoint: the API, the VCI
293296feature and ` ModuleConfig::OPTION_API_VCI_CREDENTIAL_OFFER_ENDPOINT_ENABLED ` . With the VCI feature switched off
@@ -325,7 +328,8 @@ A JSON object with the following fields. Moments are numbers of seconds since th
325328* __ redeemable_until__ (number): when its pre-authorized code or issuer state expires.
326329* __ redeemed_at__ (number or ` null ` ): when an access token was first issued for the offer, ` null ` until then. It says
327330that a token was issued, not that a credential reached a wallet.
328- * __ withdrawn_at__ (number or ` null ` ): reserved for withdrawing an offer; always ` null ` for now.
331+ * __ withdrawn_at__ (number or ` null ` ): when the offer was withdrawn (see
332+ [ Credential Offer Withdrawal] ( #credential-offer-withdrawal ) ), ` null ` while it is not.
329333* __ credentials__ (array): the credentials issued from the offer, in the order they were issued, at most 500 per
330334page. Each is an object with:
331335 * __ credential_id__ (string): the credential's ` jti ` , which the credential status endpoint takes.
@@ -390,6 +394,74 @@ Response:
390394}
391395```
392396
397+ ### Credential Offer Withdrawal
398+
399+ Withdraws a credential offer, so that it issues nothing more:
400+
401+ * the token endpoint no longer redeems the offer's pre-authorized code or issuer state, and answers a wallet which
402+ presents one with ` invalid_grant ` ;
403+ * an authorization request carrying the offer's ` issuer_state ` is refused (` invalid_request ` ) before the user is
404+ asked to log in;
405+ * the credential endpoint refuses the access tokens already issued for the offer, with ` 401 ` ` invalid_token ` .
406+
407+ Credentials already issued from the offer are left as they are: to revoke them, list them with
408+ [ Credential Offer Details] ( #credential-offer-details ) and change the status of each. A listing taken after the
409+ withdrawal holds every credential the offer handed out, because the credential endpoint asks whether the offer is
410+ withdrawn once more after a request's credentials are linked to the offer and before it hands them out. A response
411+ already on its way may still reach the wallet after the withdrawal; its credentials are in the listing all the same.
412+
413+ It is served under the same settings as the [ Credential Offer] ( #credential-offer ) endpoint.
414+
415+ #### Path
416+
417+ ` /api/vci/credential-offer/{offer_id}/withdraw ` , with the ` offer_id ` the credential offer endpoint answered.
418+
419+ #### Method
420+
421+ ` POST ` , with no body.
422+
423+ #### Authorization
424+
425+ As for [ Credential Offer Details] ( #credential-offer-details ) : a bearer token from the ` Authorization ` header, with
426+ one of the scopes of the credential offer endpoint, standing for the principal which made the offer, and with every
427+ credential configuration the offer offered still in its ` credential_configuration_ids ` .
428+
429+ #### Response
430+
431+ A JSON object with the following fields:
432+
433+ * __ withdrawn_at__ (number): when the offer was withdrawn, in seconds since the epoch (UTC).
434+ * __ changed__ (boolean): whether this request is what withdrew it. ` false ` means the offer was withdrawn already, so
435+ a caller retrying a request it never saw the answer to can tell which happened; ` withdrawn_at ` is then the moment of
436+ the first withdrawal.
437+
438+ Errors:
439+
440+ * ` 401 unauthorized ` : no bearer token, or one which is not configured.
441+ * ` 403 insufficient_scope ` : the token is configured but has none of the scopes this endpoint accepts.
442+ * ` 404 not_found ` : no offer with that identifier can be withdrawn, for any of the reasons
443+ [ Credential Offer Details] ( #credential-offer-details ) answers ` 404 ` for, with the same response body.
444+ * ` 500 server_error ` : the offer could not be read or withdrawn, or the token's name or ` credential_configuration_ids `
445+ could not be read from the configuration. The cause is in the log.
446+
447+ #### Sample
448+
449+ Request:
450+
451+ ``` shell
452+ curl --location --request POST ' https://idp.example.org/ssp/module.php/oidc/api/vci/credential-offer/8f4c2a1e9d7b6053c4e1f2a8b9d0c7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0/withdraw' \
453+ --header ' Authorization: Bearer ***'
454+ ```
455+
456+ Response:
457+
458+ ``` json
459+ {
460+ "withdrawn_at" : 1794392400 ,
461+ "changed" : true
462+ }
463+ ```
464+
393465### Credential Status
394466
395467Withdraws, suspends or reinstates a Verifiable Credential which has already been issued, by moving its
@@ -457,13 +529,6 @@ credential configuration which is not in the token's `credential_configuration_i
457529configuration is not recorded, and one issued from a credential offer another principal made, are all answered
458530the same way, so that the endpoint can not be used to find out which identifiers exist. A token with ` ['*'] `
459531included: only the administration screens can change a credential whose configuration is not recorded.
460-
461- A credential issued from an offer an API token made can have its status changed by that token's principal only
462- (see [ Naming a token] ( #naming-a-token ) ), whatever the other tokens' configurations: otherwise an integration sharing
463- a credential configuration with another could revoke, suspend or reinstate the other's credentials, whose
464- identifiers travel inside them to every verifier they are shown to. Any other credential, one a wallet obtained
465- without an offer or from an offer made from the administration screens, is changed under the token's credential
466- configurations alone.
467532* ` 409 conflict ` : another change landed at the same moment and the credential ended up holding
468533something other than what was asked for. Read the current status and decide again.
469534* ` 422 unsupported_status ` : the Status List this credential belongs to was created without room for
@@ -472,6 +537,13 @@ pool which may suspend has to be configured with at least 2 bits before its cred
472537* ` 500 server_error ` : the status could not be changed, or the token's name or
473538` credential_configuration_ids ` could not be read from the configuration. The cause is in the log.
474539
540+ A credential issued from an offer an API token made can have its status changed by that token's principal only
541+ (see [ Naming a token] ( #naming-a-token ) ), whatever the other tokens' configurations: otherwise an integration sharing
542+ a credential configuration with another could revoke, suspend or reinstate the other's credentials, whose
543+ identifiers travel inside them to every verifier they are shown to. Any other credential, one a wallet obtained
544+ without an offer or from an offer made from the administration screens, is changed under the token's credential
545+ configurations alone.
546+
475547#### Sample 1
476548
477549Revoke a credential.
0 commit comments