UNPKG

@authduo/authduo

Version:

Free User-sovereign Authentication for the World

27 lines (26 loc) 1.23 kB
import { Keys } from "./keys.js"; import { Claim } from "./claim.js"; import { Pubkey } from "../pubkey.js"; import { ProofPayload, ProofVerification } from "./types.js"; /** * Login proof token -- proof that a user is logged in * - proves that a user is logged in, signed by the user's passport * - can verify LoginKeys tokens and LoginClaim tokens * - contains user info, the passport public key, and the login public key * - you can send this around freely to any services that need to know if the user is logged in, or any service that needs to verify any claims you sign with the login keys */ export declare class Proof { readonly token: string; readonly payload: ProofPayload; constructor(token: string, payload: ProofPayload); get audience(): string; get expiresAt(): number; get thumbprint(): string; getPassportPubkey(): Promise<Pubkey>; getLoginPubkey(): Promise<Pubkey>; isExpired(): boolean; verifyLogin(loginToken: string): Promise<Keys>; verifyClaim(claimToken: string): Promise<Claim<unknown>>; static decode(token: string): import("../jwt/types.js").WebToken<ProofPayload>; static verify(token: string, options: ProofVerification): Promise<Proof>; }