UNPKG

lets-mfa

Version:

Free, secure, and quick way to add MFA to your existing app. No user migrations or re-architecture needed!

41 lines 2.04 kB
import jose from "jose"; export interface LetsMFARequest { /** The realm inteded for the request */ realm: string; /** Whether this is an authorization or enrollment request. Enrollment includes account updates/changes. */ authOrEnroll: "auth" | "enroll"; /** The URL to which the client is redirected after the success or failure */ responseUrl: string; /** A unique identifier for the request, which is also included in the response, and may be * used to ensure the response matches the request. Also may be used to prevent replay attacks. */ requestId: string; /** The domain (host.tld) for which the account is valid. This must cover ALL future * response_urls the user may be redirected to. Example, a user may be redirected to * https://sub.mydomain.com and this value could be either "sub.mydomain.com" or "mydomain.com" */ domain: string; /** The public key that will be used by LetsMFA servers to encrypt the response. */ publicKey: jose.JWK; /** The URL of the log image displayed to the user when they are directed to the LetsMFA * authentication user interface. This must be served from a domain that is covered by the 'domain' property. * * For example, the value http://content.mydomain.com/logo.png is valid if the domain property is "mydomain.com" */ logoUrl?: string; /** The number of seconds UTC since the epoch of January 1st 1970 through which the user has to complete this request. This must not be too far in the future, or the * request will be rejected. */ validThrough: number; /** The display name of the user */ accountDisplayName: string; } export interface LetsMFAResponse { /** If an error occurred, the error code will be supplied */ errorCode?: string; /** If an error occurred, the error message may be supplied */ errorMessage?: string; /** The id originally provided by the requester. */ requestId?: string; } //# sourceMappingURL=request-response.d.ts.map