sveltekit-oidc - v2.0.1
    Preparing search index...

    Type Alias OIDCOptions<TIdentity, TRequestData>

    type OIDCOptions<
        TIdentity extends OIDCUserClaims = OIDCUserClaims,
        TRequestData = undefined,
    > = {
        audience?: string;
        backChannelLogoutStore?: OIDCBackChannelLogoutStore<TIdentity> | "memory";
        beforeSessionPersist?: (
            context: {
                event?: MinimalRequestEvent;
                reason: OIDCSessionReason;
                session: OIDCSession<TIdentity>;
                tokenResponse: OIDCTokenResponse;
            },
        ) => MaybePromise<void>;
        clientAuthMethod?: OIDCClientAuthMethod;
        clientId: string;
        clientSecret?: string;
        clientSecretJwt?: OIDCClientSecretJwtOptions;
        clockSkewSeconds?: number;
        cookieOptions?: Partial<CookieOptions>;
        cookieSecret: string;
        createPublicSession?: (
            context: {
                base: OIDCPublicSession<TIdentity>;
                data: TRequestData | null;
                session: OIDCSession<TIdentity>;
            },
        ) => OIDCPublicSession<TIdentity>;
        defaultLoginRedirect?: string;
        defaultLogoutRedirect?: string;
        discoveryUrl?: string;
        endpoints?: Partial<OIDCDiscoveryDocument>;
        fetch?: typeof fetch;
        fetchUserInfo?: boolean;
        issuer?: string;
        loadRequestData?: (
            context: {
                event: MinimalRequestEvent;
                session: OIDCSession<TIdentity>;
            },
        ) => MaybePromise<TRequestData>;
        logger?: OIDCLogger | false;
        loginPath?: string;
        logoutPath?: string;
        postLogoutRedirectUri?: string;
        privateKeyJwt?: OIDCPrivateKeyJwtOptions;
        redirectPath?: string;
        refreshToleranceSeconds?: number;
        resolveIdentity?: (
            context: {
                idTokenClaims: OIDCUserClaims;
                reason: OIDCSessionReason;
                userInfo?: OIDCUserClaims;
            },
        ) => MaybePromise<TIdentity>;
        scope?: string | string[];
        sessionCookieName?: string;
        sessionMaxAgeSeconds?: number;
        sessionStore?: OIDCSessionStore<TIdentity> | "memory";
        stateCookieName?: string;
    }

    Type Parameters

    Index

    Properties

    audience?: string
    backChannelLogoutStore?: OIDCBackChannelLogoutStore<TIdentity> | "memory"
    beforeSessionPersist?: (
        context: {
            event?: MinimalRequestEvent;
            reason: OIDCSessionReason;
            session: OIDCSession<TIdentity>;
            tokenResponse: OIDCTokenResponse;
        },
    ) => MaybePromise<void>

    Runs immediately before a login or refreshed session is persisted.

    clientAuthMethod?: OIDCClientAuthMethod
    clientId: string
    clientSecret?: string
    clientSecretJwt?: OIDCClientSecretJwtOptions
    clockSkewSeconds?: number
    cookieOptions?: Partial<CookieOptions>
    cookieSecret: string
    createPublicSession?: (
        context: {
            base: OIDCPublicSession<TIdentity>;
            data: TRequestData | null;
            session: OIDCSession<TIdentity>;
        },
    ) => OIDCPublicSession<TIdentity>

    Creates the browser-safe session from persisted authentication and request-only application data. Runs only when a public session is requested.

    defaultLoginRedirect?: string
    defaultLogoutRedirect?: string
    discoveryUrl?: string
    endpoints?: Partial<OIDCDiscoveryDocument>
    fetch?: typeof fetch

    Custom fetch implementation used for all OIDC network calls (discovery, token, userinfo, JWKS). Useful in dev to work around self-signed certs via a custom https.Agent — do not disable TLS verification in production.

    fetchUserInfo?: boolean
    issuer?: string
    loadRequestData?: (
        context: { event: MinimalRequestEvent; session: OIDCSession<TIdentity> },
    ) => MaybePromise<TRequestData>

    Loads application-owned data once for each authenticated request handled by handle. The result is exposed as event.locals.oidc.data and is never persisted in the OIDC session.

    logger?: OIDCLogger | false
    loginPath?: string
    logoutPath?: string
    postLogoutRedirectUri?: string
    privateKeyJwt?: OIDCPrivateKeyJwtOptions
    redirectPath?: string
    refreshToleranceSeconds?: number
    resolveIdentity?: (
        context: {
            idTokenClaims: OIDCUserClaims;
            reason: OIDCSessionReason;
            userInfo?: OIDCUserClaims;
        },
    ) => MaybePromise<TIdentity>

    Resolves application identity after provider data validation on login and refresh.

    scope?: string | string[]
    sessionCookieName?: string
    sessionMaxAgeSeconds?: number

    Maximum lifetime of a local browser session. Defaults to 8 hours.

    sessionStore?: OIDCSessionStore<TIdentity> | "memory"
    stateCookieName?: string