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 are a higher level abstraction that encapsulates the challenge and contains various settings that include the credentialQuery
, the amount of time that a challenge is valid for, what CORS domains are allowed to use the lock, the API keys that you will need to embed in your application to make use of the lock, etc.