import { AcrValue } from './params'; export type AuthenticationContext = { /** `null` when the token has no `acr` (a single-factor sign-in). */ acr: AcrValue | null; /** Methods used. Empty when the token has no `amr`. Informational only. */ amr: string[]; /** Seconds since the epoch. From the ID token when one is present. */ authTime: number | null; }; export type AuthenticationContextRequirement = { acr?: AcrValue; maxAge?: number; }; type AuthenticationClaims = { acr?: unknown; amr?: unknown; auth_time?: unknown; iss?: unknown; }; /** * Reads `acr`, `amr`, and `auth_time` from decoded tokens. * `auth_time` comes from the ID token when the SDK has one, otherwise the access token. */ export declare const readAuthenticationContext: (tokens: { idToken?: AuthenticationClaims | null; accessToken?: AuthenticationClaims | null; }) => AuthenticationContext | null; /** * Authentication context of the current session. * `authTime` comes from the ID token when one exists, otherwise the access token. * Discovery is read for `domain` only when the token issuer is that same origin. * When the issuer does not match, discovery fails, or `acr_values_supported` * is absent, `authTime` is `null` because the token value may be unreliable. * A failed discovery fetch is reused briefly, so a later read does not wait * on an unreachable host. */ export declare const getAuthenticationContext: (domain: string) => Promise; /** * Synchronous `getAuthenticationContext`. Throws when the active storage is async-only. * Uses the cached discovery document for `domain` when the token issuer matches it. * Until that check has resolved or failed, `authTime` is the token value. * A mismatched issuer, a failed fetch, or a cached unsupported result clears * `authTime`, including after it expires and while discovery retries. */ export declare const getAuthenticationContextSync: (domain: string) => AuthenticationContext | null; /** * Whether `ctx` meets `requirement`. * Ordering is none < mfa < phr. `phr` meets an `mfa` requirement. * `amr` is never consulted. A missing `authTime` fails a `maxAge` check. * * Pass a requirement to read the current session. A `maxAge` check also needs * the configured domain, and discovery is fetched for that domain only. */ export declare function hasAuthenticationContext(ctx: AuthenticationContext, requirement: AuthenticationContextRequirement, now?: number): boolean; export declare function hasAuthenticationContext(requirement: AuthenticationContextRequirement, domain?: string, now?: number): Promise; export {};