Token Endpoint
POST/auth/token
Users receive access tokens after they present a valid EBSI Verifiable Credential and prove ownership over their DID.
The Verifiable Presentation (and the credentials it carries) can follow either VCDM 1.1 or VCDM 2.0; the version is detected from the presented VP JWT, and a presentation can't mix versions:
- VCDM 1.1: the presentation sits in the
vpclaim of the JWT (@contextstarting withhttps://www.w3.org/2018/credentials/v1) and itsverifiableCredentialentries are VC JWT strings (with a nestedvcclaim). Credentials are validated against the VCDM 1.1 trust model (IssuanceCertificate). - VCDM 2.0: the JWT header
typisvp+jwtand the payload is the presentation itself (@contextstarting withhttps://www.w3.org/ns/credentials/v2). ItsverifiableCredentialentries areEnvelopedVerifiableCredentialobjects whoseidisdata:application/vc+jwt,<VC JWT>, each VC JWT being a flatvc+jwt. Credentials are validated against the VCDM 2.0 trust model (AttestationPolicy,AccreditationPolicyandTrustFrameworkPolicy).
In both versions iss and holder are the holder's DID, and exp, iat, nbf, aud and nonce are top-level JWT claims.
The iss and sub claims of the issued tokens are the presentation's holder.
VCDM 1.1 presentations are always accepted. VCDM 2.0 presentations are only accepted by the nodes that
have enabled them: any other node rejects them with an invalid_request error whose description is
VCDM 2.0 presentations are not supported.
Request
Responses
- 200
- 400
- 405
- 406
- 413
- 415
- 500
Success
Response Headers
Bad Request. Failures raised while handling the token request (wrong content type, body
validation, presentation and credential verification) are returned as an OAuth 2.0 error
response (application/json), not application/problem+json. Most server_error
failures (e.g. the DID Registry being unreachable) are also HTTP 400 here rather than 500;
the exception is the nonce store being unavailable, see 500.
Failures that happen before the request reaches the endpoint (body larger than the
limit, unparsable body, unsupported media type, Accept header mismatch, method not
allowed) are Problem Details responses instead, see 405, 406, 413 and 415.
Method Not Allowed. Returned for any documented path invoked with an HTTP method it doesn't support.
Response Headers
Comma-separated list of HTTP methods supported by this path.
GET, HEADNot Acceptable. Returned when the request's Accept header matches none of the content
types this operation can produce. The detail lists them: Only '<type>' content type supported when the operation produces a single one, Only '<type>' or '<type>' content types supported when it produces several.
Payload Too Large. The request body exceeds the limit of this endpoint (64 KiB by
default, since the body only carries a vp_token). Returned as Problem Details, not as
an OAuth 2.0 error.
Unsupported Media Type. Returned as Problem Details when the Content-Type of the
request is one the server cannot parse at all. Any other content type that is not
application/x-www-form-urlencoded is rejected with the OAuth 2.0 invalid_request
error described in 400.
Internal Server Error. Either an OAuth 2.0 server_error response (application/json),
returned when the single-use check of the presentation's nonce cannot be performed
because the nonce store is unreachable (the token is never issued in that case), or a
Problem Details response (application/problem+json) for any other unexpected error.