The QuickCheckin/QuickLogin API is the Yang to the Issuance API’s Yin. It allows a verifier to challenge a wallet holder to cryptographically prove that they are in possession of a valid credential by some set of criteria. What criteria? Read on to find out.
Terms:
The general flow of presenting a credential for a QuickLogin or QuickCheckin is as follows:
sequenceDiagram
participant FE as 3rd Party Frontend
participant HeirloomBE as Heirloom Backend
autonumber
Note over FE: "QuickLogin" button clicked
FE->>HeirloomBE: POST /auth/sessions/challenges
HeirloomBE->>FE: Return loginChallenge
FE-->>FE: Open WebSocket
activate FE
Note over FE: Render QR code
create participant Device as Mobile Device
FE-->Device: Mobile Device scans QR code
Note over Device: Construct VP
Device->>HeirloomBE: POST /auth/verify-presentation
Note over HeirloomBE: Validate Credentials
HeirloomBE-->>FE: Send payload to Frontend<br>(WebSocket)
deactivate FE
destroy Device
HeirloomBE->>Device: 201 Response
FE->>FE: Handle payload
loginChallenge
(See details below)loginChallenge
to render a QR to display to the userA challenge accomplishes two things: it provides an interface for specifying what credentials are accepted to satisfy the challenge, and it ensures protection against replayability of signatures. Encoded in the challenge is a credentialQuery
which provides a (relatively) light-weight interface for specifying what credentials will satisfy the challenge, and a randomly generated value that is required to be included in a presentation. This is all wrapped up in a JWT that is signed by Heirloom’s servers to ensure that the challenge was authentically generated by Heirloom’s API.
Locks encapsulate the challenge and represent the credentialQuery
. Locks are modular and can contain settings such as CORS domain, the amount of time that a challenge is valid for, etc. Upon creation, each Lock is assigned a unique Lock ID (visible in Heirloom Creator). The Lock ID is used during WebSocket topic subscription.