Skip to main content

QTOTPFactor

@quik/mfa


@quik/mfa / QTOTPFactor

Class: QTOTPFactor

Defined in: mfa/src/factors/QTOTPFactor.ts:36

TOTP MFA factor implementation.

Extends​

  • QObject

Implements​

Constructors​

Constructor​

new QTOTPFactor(options): QTOTPFactor

Defined in: mfa/src/factors/QTOTPFactor.ts:57

Creates a TOTP factor.

Parameters​

options​

QTOTPFactorOptions

Factor options.

Returns​

QTOTPFactor

Overrides​

QObject.constructor

Properties​

digits​

protected readonly digits: number

Defined in: mfa/src/factors/QTOTPFactor.ts:40

TOTP digit count.


getSecret​

protected readonly getSecret: QTOTPSecretResolver

Defined in: mfa/src/factors/QTOTPFactor.ts:50

User secret resolver callback.


maxAttempts​

protected readonly maxAttempts: number

Defined in: mfa/src/factors/QTOTPFactor.ts:48

Maximum attempts for generated challenges.


method​

readonly method: string

Defined in: mfa/src/factors/QTOTPFactor.ts:38

Factor method key.

Implementation of​

IQMFAFactor.method


stepSeconds​

protected readonly stepSeconds: number

Defined in: mfa/src/factors/QTOTPFactor.ts:42

TOTP time step in seconds.


ttlMs​

protected readonly ttlMs: number

Defined in: mfa/src/factors/QTOTPFactor.ts:46

Challenge TTL in milliseconds.


window​

protected readonly window: number

Defined in: mfa/src/factors/QTOTPFactor.ts:44

Accepted drift window in number of steps.

Accessors​

logger​

Get Signature​

get protected logger(): IQLogger

Defined in: core/src/QObject.ts:15

The logger getter for the object.

Returns​

IQLogger

Inherited from​

QObject.logger


name​

Get Signature​

get name(): string

Defined in: core/src/QObject.ts:8

Returns​

string

Inherited from​

QObject.name

Methods​

endSpan()​

protected endSpan(span): void

Defined in: core/src/QObject.ts:35

End a span returned by startSpan.

Parameters​

span​

TelemetrySpan

The span to end.

Returns​

void

Inherited from​

QObject.endSpan


issue()​

issue(input): Promise<QMFAIssueResult>

Defined in: mfa/src/factors/QTOTPFactor.ts:73

Issues a challenge without generating a code.

Parameters​

input​

QMFAIssueInput | Partial<QMFAIssueInput>

Challenge input.

Returns​

Promise<QMFAIssueResult>

Implementation of​

IQMFAFactor.issue


recordSpanError()​

protected recordSpanError(span, err): void

Defined in: core/src/QObject.ts:45

Record an exception on an active span.

Parameters​

span​

TelemetrySpan

The span to record the error on.

err​

unknown

The error to record.

Returns​

void

Inherited from​

QObject.recordSpanError


setSpanAttribute()​

protected setSpanAttribute(span, key, value): void

Defined in: core/src/QObject.ts:64

Set a single attribute on an active span.

Parameters​

span​

TelemetrySpan

The span to update.

key​

string

Attribute key.

value​

string | number | boolean

Attribute value.

Returns​

void

Inherited from​

QObject.setSpanAttribute


startSpan()​

protected startSpan(spanName, options?): TelemetrySpan

Defined in: core/src/QObject.ts:26

Start a telemetry span for the given operation name. Returns undefined when no telemetry provider is active.

Parameters​

spanName​

string

Name of the span.

options?​

TelemetrySpanOptions

Optional span attributes and kind.

Returns​

TelemetrySpan

Inherited from​

QObject.startSpan


verify()​

verify(input): Promise<boolean>

Defined in: mfa/src/factors/QTOTPFactor.ts:93

Verifies a user-provided TOTP against the resolved secret.

Parameters​

input​

QMFAVerifyInput | Partial<QMFAVerifyInput>

Verification input.

Returns​

Promise<boolean>

Implementation of​

IQMFAFactor.verify