Request Service REST API presentation specification

Note

Azure Active Directory Verifiable Credentials is now Microsoft Entra Verified ID and part of the Microsoft Entra family of products. Learn more about the Microsoft Entra family of identity solutions and get started in the unified Microsoft Entra admin center.

Microsoft Entra Verified ID includes the Request Service REST API. This API allows you to issue and verify a credential. This article specifies the Request Service REST API for a presentation request. The presentation request asks the user to present a verifiable credential, and then verify the credential. Another article describes how to call the Request Service REST API.

HTTP request

The Request Service REST API presentation request supports the following HTTP method:

Method Notes
POST With JSON payload as specified in this article.

The Request Service REST API presentation request requires the following HTTP headers:

Method Value
Authorization Attach the access token as a bearer token to the authorization header in an HTTP request. For example, Authorization: Bearer <token>.
Content-Type Application/json

Construct an HTTP POST request to the Request Service REST API. The tenantId isn't needed in the URL anymore since it is present as a claim in the access_token.

https://verifiedid.did.msidentity.com/v1.0/verifiableCredentials/createPresentationRequest

The following HTTP request demonstrates a presentation request to the Request Service REST API:

POST https://verifiedid.did.msidentity.com/v1.0/verifiableCredentials/createPresentationRequest
Content-Type: application/json
Authorization: Bearer  <token>

{
    "includeQRCode": true,
    "callback": {
    "url": "https://www.contoso.com/api/verifier/presentationCallbac",
    "state": "11111111-2222-2222-2222-333333333333",
      "headers": {
        "api-key": "an-api-key-can-go-here"
      }
    },
    ...
}

The following permission is required to call the Request Service REST API. For more information, see Grant permissions to get access tokens.

Permission type Permission
Application 3db474b9-6a0c-4840-96ac-1fceb342124f/.default

Presentation request payload

The presentation request payload contains information about your verifiable credentials presentation request. The following example demonstrates a presentation request from a specific issuer. The result of this request returns a QR code with a link to start the presentation process.

{
  "includeQRCode": true,
  "includeReceipt": true,
  "authority": "did:ion:EiCLL8lzCqlGLYTGbjwgR6SN6OABCO6uUKyF5zM7fQZ8Jg:eyJ...<SNIP>...",
  "registration": {
    "clientName": "Veritable Credential Expert Verifier"
  },
  "callback": {
    "url": "https://www.contoso.com/api/verifier/presentationCallback",
    "state": "92d076dd-450a-4247-aa5b-d2e75a1a5d58",
    "headers": {
      "api-key": "OPTIONAL API-KEY for CALLBACK EVENTS"
    }
  },
  "requestedCredentials": [
    {
      "type": "VerifiedCredentialExpert",
      "purpose": "So we can see that you a veritable credentials expert",
      "acceptedIssuers": [
        "did:ion:EiCLL8lzCqlGLYTGbjwgR6SN6OABCO6uUKyF5zM7fQZ8Jg:eyJ...<SNIP>..."
      ],
      "configuration": {
        "validation": {
          "allowRevoked": false,
          "validateLinkedDomain": false
        }
      }
    }
  ]
}

The payload contains the following properties.

Parameter Type Description
includeQRCode Boolean Determines whether a QR code is included in the response of this request. Present the QR code and ask the user to scan it. Scanning the QR code launches the authenticator app with this presentation request. Possible values are true (default) or false. When you set the value to false, use the return url property to render a deep link.
includeReceipt Boolean Determines whether a receipt should be included in the response of this request. Possible values are true or false (default). The receipt contains the original payload sent from the authenticator to the Verifiable Credentials service. The receipt is useful for troubleshooting or if you have the need to ge the full details of the payload. There's otherwise no need be set this value to true by default. In the OpenId Connect SIOP request, the receipt contains the ID token from the original request.
authority string Your decentralized identifier (DID) of your verifier Azure AD tenant. For more information, see Gather tenant details to set up your sample application.
registration RequestRegistration Provides information about the verifier.
callback Callback Mandatory. Allows the developer to update the UI during the verifiable credential presentation process. When the user completes the process, continue the process after the results are returned to the application.
requestedCredentials collection A collection of RequestCredential objects.

RequestRegistration type

The RequestRegistration type provides information registration for the issuer. The RequestRegistration type contains the following properties:

Property Type Description
clientName string A display name of the issuer of the verifiable credential. This name will be presented to the user in the authenticator app.

The following screenshot shows the clientName property and the display name of the authority (the verifier) in the presentation request.

Screenshot that shows how to approve the presentation request.

Callback type

The Request Service REST API generates several events to the callback endpoint. Those events allow you to update the UI and continue the process after the results are returned to the application. The Callback type contains the following properties:

Property Type Description
url string URI to the callback endpoint of your application. The URI must point to a reachable endpoint on the internet otherwise the service will throw a callback URL unreadable error. Accepted inputs IPv4, IPv6 or DNS resolvable hostname.
state string Correlates the callback event with the state passed in the original payload.
headers string Optional. You can include a collection of HTTP headers required by the receiving end of the POST message. The current supported header values are the api-key or the Authorization headers. Any other header will throw an invalid callback header error.

RequestCredential type

The RequestCredential provides information about the requested credentials the user needs to provide. RequestCredential contains the following properties:

Property Type Description
type string The verifiable credential type. The type must match the type as defined in the issuer verifiable credential manifest (for example, VerifiedCredentialExpert). To get the issuer manifest, see Gather credentials and environment details to set up your sample application. Copy the Issue credential URL, open it in a web browser, and check the id property.
purpose string Provide information about the purpose of requesting this verifiable credential.
acceptedIssuers string collection A collection of issuers' DIDs that could issue the type of verifiable credential that subjects can present. To get your issuer DID, see Gather credentials and environment details to set up your sample application, and copy the value of the Decentralized identifier (DID). If the acceptedIssuers collection is empty, then the presentation request will accept a credential type issued by any issuer.
configuration.validation Configuration.Validation Optional settings for presentation validation.

Configuration.Validation type

The Configuration.Validation provides information about how the presented credentials should be validated. It contains the following properties:

Property Type Description
allowRevoked Boolean Determines if a revoked credential should be accepted. Default is false (it shouldn't be accepted).
validateLinkedDomain Boolean Determines if the linked domain should be validated. Default is false. Setting this flag to false means you as a Relying Party application accept credentials from an unverified linked domain. Setting this flag to true means the linked domain will be validated and only verified domains will be accepted.

Successful response

If successful, this method returns a response code (HTTP 201 Created), and a collection of event objects in the response body. The following JSON demonstrates a successful response:

{
    "requestId": "e4ef27ca-eb8c-4b63-823b-3b95140eac11",
    "url": "openid://vc/?request_uri=https://verifiedid.did.msidentity.com/v1.0/12345678-0000-0000-0000-000000000000/verifiableCredentials/request/e4ef27ca-eb8c-4b63-823b-3b95140eac11",
    "expiry": 1633017751,
    "qrCode": "data:image/png;base64,iVBORw0KGgoA<SNIP>"
}

The response contains the following properties:

Property Type Description
requestId string An autogenerated request ID. The callback uses the same request, allowing you to keep track of the presentation request and its callbacks.
url string A URL that launches the authenticator app and starts the presentation process. You can present this URL to the user if they can't scan the QR code.
expiry integer Indicates when the response will expire.
qrCode string A QR code that the user can scan to start the presentation flow.

When your app receives the response, the app needs to present the QR code to the user. The user scans the QR code, which opens the authenticator app and starts the presentation process.

Error response

If there's an error with the request, an error responses is returned, and should be handled appropriately by the app.

Callback events

The callback endpoint is called when a user scans the QR code, uses the deep link the authenticator app, or finishes the presentation process.

Property Type Description
requestId string Mapped to the original request when the payload was posted to the Verifiable Credentials service.
requestStatus string The status returned when the request was retrieved by the authenticator app. Possible values:
  • request_retrieved: The user scanned the QR code or selected the link that starts the presentation flow.
  • presentation_verified: The verifiable credential validation completed successfully.
state string Returns the state value that you passed in the original payload.
subject string The verifiable credential user DID.
issuers array Returns an array of verifiable credentials requested. For each verifiable credential, it provides:
  • The verifiable credential type(s).
  • The issuer's DID
  • The claims retrieved.
  • The verifiable credential issuer's domain.
  • The verifiable credential issuer's domain validation status.
  • receipt string Optional. The receipt contains the original payload sent from the wallet to the Verifiable Credentials service. The receipt should be used for troubleshooting/debugging only. The format in the receipt isn't fix and can change based on the wallet and version used.

    The following example demonstrates a callback payload when the authenticator app starts the presentation request:

    {
        "requestId": "e4ef27ca-eb8c-4b63-823b-3b95140eac11",
        "requestStatus":"request_retrieved",
        "state": "92d076dd-450a-4247-aa5b-d2e75a1a5d58"
    }
    

    The following example demonstrates a callback payload after the verifiable credential presentation has successfully completed:

    {
      "requestId": "e4ef27ca-eb8c-4b63-823b-3b95140eac11",
      "requestStatus": "presentation_verified",
      "state": "92d076dd-450a-4247-aa5b-d2e75a1a5d58",
      "subject": "did:ion:EiAlrenrtD3Lsw0GlbzS1O2YFdy3Xtu8yo35W<SNIP>…",
      "verifiedCredentialsData": [
        {
          "issuer": "did:ion:issuer",
          "type": [
            "VerifiableCredential",
            "VerifiedCredentialExpert"
          ],
          "claims": {
            "firstName": "Megan",
            "lastName": "Bowen"
          },
          "credentialState": {
            "revocationStatus": "VALID"
          },
          "domainValidation": {
            "url": "https://contoso.com/"
          }
        }
      ],
      "receipt": {
        "id_token": "eyJraWQiOiJkaWQ6aW<SNIP>",
        "vp_token": "...",
        "state": "..."
      }
    }
    

    Next steps

    Learn how to call the Request Service REST API.