Resolution (DCP)
The POST request to the /presentations/query endpoint queries the holder for credentials, after which the holder sends a set of Verifiable Presentations as a response.
The Resolution API defines the Credential Service endpoint for querying credentials and returning a set of Verifiable Presentations. More information in the [DCP specification](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#resolution-api.
iSHARE JWT Bearer token authentication
VP request received successfully
Bad Request - possibly because both PresentationQueryMessage and presentationDefinition are provided (only one is allowed)
Internal Server Error
POST /presentations/query HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2
{}{}Request model
The model for the PresentationQueryMessage is defined in: https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/presentation/presentation-query-message-schema.json. Verifiable presentations containing credentials may be requested using scopes or using a presentation definition.
@contextArray of Strings. Root level. (Required) Specifies a valid Json-Ld context. Must contain"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"typeString. Root level. (Required) A string specifying the PresentationQueryMessage type. Must contain"PresentationQueryMessage"scopeArray of Strings. Root level. A non-empty array of scopes.presentationDefinitionObject. Root level. An object containing the definition of the requested presentation. Further details on https://identity.foundation/presentation-exchange/spec/v2.1.1/#presentation-definition.
A PresentationQueryMessage MUST contain either a presentationDefinition or a scope parameter. If both parameters are present it is an error and the client MUST return an HTTP 400 BAD REQUEST response.
Example request
Example using scopes
POST /presentations/query
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"@context": [
"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
],
"type": "PresentationQueryMessage",
"scope": [
"presentation1",
"presentation2"
]
}Example using presentation definition
POST /presentations/query
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"@context": [
"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
],
"type": "PresentationQueryMessage",
"presentationDefinition": {
"id": "ishareFrameworkCompliance",
"name": "iSHARE Framework Compliance",
"purpose": "Request proof of compliance with the iSHARE Framework",
"input_descriptors": [
{
"id": "ishareFrameworkComplianceFrameworkIdAndStatus",
"format": {
"ldp_vc": {
"proof_type": [
"Ed25519Signature2018"
]
}
},
"constraints": {
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "string",
"pattern": "FrameworkCompliance"
}
},
{
"path": [
"$.frameworkId"
],
"filter": {
"type": "string",
"pattern": "iSHARE"
}
},
{
"path": [
"$.status"
],
"filter": {
"type": "string",
"pattern": "active"
}
}
]
}
}
]
}
}Response model
On succesfull receipt of the PresentationRequestMessage, the holder must return a 200 code and a PresentationResponseMessage. A PresentationResponseMessage should only include valid (non-expired, non-revoked, non-suspended) credentials. The model for the PresentationQueryMessage is defined in: https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/presentation/presentation-response-message-schema.json.
@contextArray of Strings. Root level. (Required) Specifies a valid Json-Ld context. Must contain"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"typeString. Root level. (Required) A string specifying the PresentationResponseMessage type. Must contain"PresentationResponseMessage"presentationArray of Strings. Root level. An array of Verifiable Presentations. The Verifiable Presentations may be strings, JSON objects, or a combination of both depending on the format.presentationSubmissionObject. Root level. A valid Presentation Submission. Further details on https://identity.foundation/presentation-exchange/spec/v2.1.1/.
Implementations that support the presentationDefinition parameter MUST include the presentationSubmission parameter.
Example response
Example including presentations
{
"@context": [
"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
],
"type": "PresentationResponseMessage",
"presentation": [
"presentation1",
"presentation2"
]
}Example including presentation and presentationSubmission
{
"@context": [
"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
],
"type": "PresentationResponseMessage",
"presentation": [
"jwtPresentation"
],
"presentationSubmission": {
"id": "ishareFrameworkCompliancePresentation",
"definition_id": "ishareFrameworkCompliance",
"descriptor_map": [
{
"id": "ishareFrameworkComplianceFrameworkIdAndStatus",
"format": "jwt_vp",
"path": "$.presentation[0]"
}
]
}
}Last updated