Setu-TS
    Preparing search index...

    Interface ISamlRequestStore

    Store port for pending SAML requests and consumed assertion ids.

    All methods are async so a shared backend (Redis, a database) can implement the interface; an application running several replicas MUST supply one, because a login started on one replica is answered on whichever receives the IdP's POST.

    0.8.0

    interface ISamlRequestStore {
        claimAssertionId(
            assertionId: string,
            retainUntil: number,
            now: number,
        ): Promise<boolean>;
        consumeRequest(
            requestId: string,
            now: number,
        ): Promise<SamlPendingRequest | null>;
        peekRequest(
            requestId: string,
            now: number,
        ): Promise<SamlPendingRequest | null>;
        saveRequest(request: SamlPendingRequest, now: number): Promise<void>;
    }

    Implemented by

    Index
    • Atomically records an assertion id as used until retainUntil (ms). Returns true on the first claim and false when the id was already claimed and has not yet aged out.

      Parameters

      • assertionId: string
      • retainUntil: number
      • now: number

      Returns Promise<boolean>