Exchange code
During a registration or authentication operation the @passlock/client library will return a code (alongside an id_token). You can send the code to your backend then use the REST API to verify it and obtain details about the passkey used.
GET /{tenancyId}/principal/{code} HTTP/1.1Host: https://api.passlock.devAccept: application/jsonAuthorization: Bearer {apiKey}import { exchangeCode } from "@passlock/server";
// get these from your development tenancy settingsconst tenancyId = "myTenancyId";const apiKey = "myApiKey";
const result = await exchangeCode({ code, tenancyId, apiKey });Response properties
Section titled “Response properties”See principal