Claims
OpenAPI documentation for the Claims module
Claim credential
Claim specific credential. User has to pass authorization token in header and data in request body.
authorization
header has to contain Bearer
and token returned from previous token endpoint.
In request body user has to pass types
array with type of credential being claimed, format
string with format of the credential,
and proof
object with proof_type
string and jwt
string. proof_type
is a string that represents the type of the proof, which is in our case jwt
.
jwt
is a string that represents the JWT token which is generated by wallet and acts as a proof of posession JWT. If successful, the server returns
an object with credential
, format
, c_nonce
and c_nonce_expires_in
properties. credential
is a string that represents the JWT token which contains
all the details about the claimed credential. format
is a string that represents the format of the credential. c_nonce
is a string that
represents c-nonce and c_nonce_expires_in
is a number that represents the expiration time of the c-nonce in seconds.
The correlation ID defined on the server (nchain in our case).
The type of the credential we choose when issuing.
The format of the credential we choose when issuing.
"jwt_vc_json"
JWT token which contains all the details about the claimed credential.
"eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE3MDg1Mjg4NjIsInZjIjp7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy8yMDE4L2NyZWRlbnRpYWxzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJDaGFyYWN0ZXJDcmVkZW50aWFsIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7Im5hbWUiOiJZZWxsb3ciLCJiaW9ncmFwaHkiOiJZb3UmI3gyNztyZSBjaGVlcmZ1bCBhbmQgb3B0aW1pc3RpYywgYnJpbmdpbmcgam95IGFuZCBwb3NpdGl2aXR5IHdoZXJldmVyIHlvdSBnby4gWW91ciBzdW5ueSBkaXNwb3NpdGlvbiBhbmQgaW5mZWN0aW91cyBsYXVnaHRlciBicmlnaHRlbiBldmVuIHRoZSBkYXJrZXN0IG9mIGRheXMuIFdpdGggYSBoZWFydCBmdWxsIG9mIGNvbXBhc3Npb24gYW5kIGVtcGF0aHksIHlvdSYjeDI3O3JlIGFsd2F5cyByZWFkeSB0byBsZW5kIGEgaGVscGluZyBoYW5kIHRvIHRob3N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wNDUwNzQzYmE2Yjg1MTk4MzMyNWQiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTAyLTE0VDE0OjIxOjAyLjgxMFoiLCJzdWIiOiJkaWQ6YnN2OmVjYWE0MDI4ZWMzYzM2N2IwZTkwNzI3ZmI1ZTY3ZWQwMTczNjA0ZWE2ZmVjYzRiMmM4YzI4ZTFlNjQxMjYyMTQiLCJuYmYiOjE3MDc5MjA0NjIsImlzcyI6ImRpZDpic3Y6ZDdkZGNjMDBjMTRmOWJjY2UxMTM1ZmMzYjMyNjE0YTFiM2I0NzIwYmU2NDA0NTA3NDNiYTZiODUxOTgzMzI1ZCJ9.BNtaFqWdZNCmCXodN8tZ5MHOflzxQnbnFnYAJcWruQMXF-l8V4c2nsyb-3mgdGy38SowpJgHplZri6-TkcM_mA"
The format of the credential.
"jwt_vc_json"
String representing c-nonce.
"bea65ef2-ebd3-4006-b095-e5fbd6d96ccd"
Number representing the expiration time of the c-nonce in seconds.
300000
Get access token to start the credential issuance.
Before claiming the credential, the user has to get an access token. This endpoint facilitates the retrieval
of an access token with the provided client_id
, grant_type
and pre-authorized_code
. The client_id
is
a string that represents the client ID. The grant_type
is a string that represents the grant type, which is in our case
urn:ietf:params:oauth:grant-type:pre-authorized_code
. The pre-authorized_code
is a string that represents the pre-authorized code,
which is generated by the web client when creating an offer. If successful, the server returns an object with access_token
, token_type
,
expires_in
, c_nonce
, c_nonce_expires_in
, authorization_pending
and interval
properties. access_token
is a string that represents
the access token. token_type
is a string that represents the token type (bearer in our case). expires_in
is a number that represents the
expiration time of the token in seconds. c_nonce
is a string that represents the c-nonce. c_nonce_expires_in
is a number that represents
the expiration time of the c-nonce in seconds. authorization_pending
is a boolean that indicates if the authorization is pending
(not used in our case). interval
is a number that represents the interval in milliseconds.
The correlation ID defined on the server (nchain in our case).
The client ID.
"nChain:vc-wallet"
The grant type to use
"urn:ietf:params:oauth:grant-type:pre-authorized_code"
Pre Authorized code that references the credential to start token fetching
"ab407be3-d18f-4508-837e-6286329c1da2"
String representing access token
"eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJpYXQiOjE3MDc5MjA5OTkxMTIsImV4cCI6MzAwLCJpc3MiOiJuY2hhaW4iLCJwcmVBdXRob3JpemVkQ29kZSI6ImExNmE0ZDIzLTZlZWEtNGE3MC1iZWU5LWE3MDRjYWY0NjQ1OSJ9.yqaNyNG_oiah3cb9ELU-ukKqxk_Utt5ntNeFuzC69w4LToRqHHWrMibyupluzKFxSiqEZ7lsKFta2mUdhPIO_Q"
String representing token type
"bearer"
String containing a nonce to be used when creating a proof of possession of the key proof. When received, the Wallet MUST use this nonce value for its subsequent requests until the Credential Issuer provides a fresh nonce.
"bea65ef2-ebd3-4006-b095-e5fbd6d96ccd"
Number denoting the lifetime in seconds of the c_nonce.
30000
Boolean indicating if the authorization is pending.
false
300000
Create credential offer for the specified credential type.
Endpoint will return credential data that can be claimed which is transformed in QR code by web client, for wallet app to scan.
User has to pass data in request body for which credential one wants to trigger issueance. In this example we will use Character credential.
We want to create body with properties credentials
which is an array of strings and has to contain CharacterCredential type as string.
We also want to pass grants
object with urn:ietf:params:oauth:grant-type:pre-authorized_code
as key and object with pre-authorized_code
which is a random id web client generates to later access status of issued credential, and user_pin_required
property, which is set to false
in this case. Last thing we want to pass is credentialDataSupplierInput
object with properties for specified credential type. Those properties are
written in JSON file in /dev/oid4vci_metadata
directory in object credentialSubject
. In this case we want to pass name
and biography
.
If successful, the server returns a URI (in url encoded format) containing the credential offer and a boolean indicating if user pin is
required (we set it to false).
The correlation ID defined on the server (nchain in our case).
The type of the credential we want to issue.
The input for the credential data supplier. Depends on the credential type.
URI containing the credential offer (decoded in example).
"openid-credential-offer://?credential_offer={\\\"grants\\\":{\\\"urn:ietf:params:oauth:grant-type:pre-authorized_code\\\":{\\\"pre-authorized_code\\\":\\\"sWoSmJM9vnD2yL3Ruot3ps\\\",\\\"user_pin_required\\\":false}},\\\"credentials\\\":[\\\"CharacterCredential\\\"],\\\"credential_issuer\\\":\\\"https://1c13-213-172-234-81.ngrok-free.app/nchain\\"
Indicates if user pin is required.
false
Check offer status.
Endpoint returns status of the credential offer that has been created (look at previous endpoint).
User has to pass id
of the offer in request body. Id is generated by web client when creating an offer (look at previous endpoint).
If successful, the server returns an object with createdAt
,lastUpdatedAt
and status
properties. createdAt
is a timestamp indicating
when the offer was created, lastUpdatedAt
is a timestamp indicating the last update time of the offer and status
is the status of the offer.
status
can be OFFER_CREATED
, CREDENTIAL_ISSUED
, ERROR
The correlation ID defined on the server (nchain in our case).
The ID of the offer.
Timestamp indicating when the offer was created.
1702632883012
Timestamp indicating the last update time of the offer.
1702632883012
The status of the offer.
"OFFER_CREATED"
Last updated