ping-identity
    Preparing search index...

    Type Alias OathCodeInfo

    OTP code along with timing and validity metadata returned by OathClient.generateCodeWithValidity.

    Fields that are not applicable to a credential type are set to sentinel values: -1 for HOTP numeric timing fields and 0.0 / 0 for HOTP progress/period fields.

    const info = await client.generateCodeWithValidity('my-totp-id');
    console.log(`OTP: ${info.code} — valid for ${info.timeRemaining}s`);
    type OathCodeInfo = {
        code: string;
        counter: number;
        progress: number;
        timeRemaining: number;
        totalPeriod: number;
    }
    Index

    Properties

    code: string

    The one-time password string.

    counter: number

    HOTP counter value after code generation.

    Set to -1 for TOTP credentials.

    progress: number

    Fraction of the TOTP period that has elapsed, in the range 0.01.0.

    Set to 0.0 for HOTP credentials.

    timeRemaining: number

    Seconds remaining in the current TOTP window.

    Set to -1 for HOTP credentials.

    totalPeriod: number

    Total TOTP period in seconds.

    Set to 0 for HOTP credentials.