Credential issuance (DCP)

Specifications and best practice implementations for Verifiable Credentials are currently being developed. This page is expected to be updated, closely following these developments.

The POST request to the /credentials endpoint with a CredentialRequestMessage requests the issuance of a credential.

The POST request to the /credentials is an OPTIONAL endpoint and is part of the iSHARE Framework's Verifiable Credentials support in line with the Decentralised Claims Protocol (DCP).

Request issuance or storage of a Verifiable Credential

post

If invoked with a credential-request message, requests the issuance of a Verifiable Credential according to the Eclipse Decentralized Claims Protocol v1.0 specification. This is applicable to issuers only. If invoked with a credential-message, requests the storage of a credential, applicable to all roles (participants), since all roles must be able to store credentials. More information in the DCP specification of the credential request API and the DCP specification of the storage API.

Authorizations
AuthorizationstringRequired

iSHARE JWT Bearer token authentication

Body
one ofOptional
all ofOptional
or
all ofOptional
Responses
post
/credentials
POST /credentials HTTP/1.1
Host: 
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2

{}

No content

Request model

The model for the CredentialRequestMessage is defined in: https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/issuance/credential-request-message-schema.json.

  • @context Array of Strings. Root level. (Required) Specifies a valid Json-Ld context. Must contain "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"

  • type String. Root level. (Required) A string specifying the CredentialRequestMessage type. Must contain "CredentialRequestMessage"

  • holderPid String. Root level. (Required) A string corresponding to the request id on the Holder side.

  • credentials Array of objects. Root level. (Required) An array of objects with an id property, each referencing a CredentialObject.

    • id String. Contained in credential object. (Required) ID referencing an id value of an object in the credentialsSupported returned from the Issuer Metadata endpoint.

Example request

POST /credentials HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json

{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "CredentialRequestMessage",
  "holderPid": "holderPid",
  "credentials": [
    {
      "id": "d5c77b0e-7f4e-4fd5-8c5f-28b5fc3f96d1"
    },
    {
      "id": "c0f81e68-6d35-4f9d-bc04-51e511b2e46c"
    }
  ]
}

Response model

After success, a 201 response will be provided. The response contains a header "Location" that contains a URL pointing to the status of the request. This URL or the ID in the URL must be stored by the issuance requestor to request the status of credential issuance in a later stage.

Last updated