Skip to content

Principal

Following a successful registration or authentication operation, your frontend code will receive a code and id_token. The code can be exchanged for an ExtendedPrincipal, while the id_token can be verified locally to obtain a Principal.

Principal.ts
export interface Principal {
_tag: "Principal";
id: string;
userId: string;
authenticatorId: string;
authenticatorType: "passkey";
passkey?: {
verified: boolean;
userVerified: boolean;
};
createdAt: number;
expiresAt: number;
}
Propertydescription
_tagDiscriminator, always "Principal"
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.verifiedShould always be true
passkey.userVerifiedWhether the device re-authenticated the user locally
createdAtTimestamp, milliseconds since epoch
expiresAtTimestamp, milliseconds since epoch. Derived from the JWT exp property

If you obtain a Principal via the code exchange flow, you will receive an ExtendedPrincipal which includes some additional properties. Like Principal, it is tagged, so _tag will be "ExtendedPrincipal".

Propertydescription
_tagDiscriminator, always "ExtendedPrincipal"
metadataRequest metadata captured during the registration or authentication operation
passkey.platformNameThe platform/ecosystem used to create the passkey e.g. Apple iCloud
metadata.ipAddressIP address of the client using the passkey
metadata.userAgentClient user agent