Skip to content

Principal

Following a successful registration or authentication operation, your frontend code will receive a code and id_token. These can be exchanged for a Principal, representing the outcome of the operation.

Principal.ts
export interface Principal {
id: string;
userId: string;
authenticatorId: string;
authenticatorType: "passkey";
passkey?: {
id: string;
verified: boolean;
userVerified: boolean;
};
createdAt: number;
expiresAt: number;
}
Propertydescription
idGenerated every time a Principal is created. Equivalent to the JWT jti property
userIdAssigned user id. By default this will be the authenticatorId, but can be changed via the REST API. See linking accounts
authenticatorIdUnique identifier i.e. the passkey id
authenticatorTypeCurrently hardcoded as “passkey”, but in the future this will be extended to support additional authenticator types e.g. Apple and Google sign in
passkey.idSame as authenticatorId
passkey.verifiedShould always be true
passkey.userVerifiedWhether the device re-authenticated the user locally
createdAtTimestamp, milliseconds since epoch
expiresAtAligns with the JWT exp property