# Interface: AuthContext

Authentication context of an already-authenticated user, passed via [`ActionEventOptions.authContext`](/sdk-ref/platform/interfaces/actioneventoptions#authcontext) in a [`drs.triggerActionEvent()`](/sdk-ref/platform/modules/drs#triggeractionevent) call. We recommend using it only when the login happened outside the current flow. If the user authenticates within the flow, report the user via [`drs.reportActionResult()`](/sdk-ref/platform/modules/drs#reportactionresult) instead.

## Properties

### userId

• **userId**: `string`

Opaque identifier of the authenticated user in your system. Required — providing an auth context indicates that the user is already authenticated (e.g. they logged in through a flow outside this SDK before reaching this action).

### loginTimestamp

• `Optional` **loginTimestamp**: `number`

Unix timestamp (ms) of when the login happened.

### challengeType

• `Optional` **challengeType**: [`ChallengeType`](/sdk-ref/platform/enums/challengetype)

The challenge type used for the authentication action (e.g. `sms_otp`, `password`, `passkey`).

### failedAttempts

• `Optional` **failedAttempts**: `number`

The number of failed attempts for the authentication action.

### authMethod

• `Optional` **authMethod**: [`AuthMethodType`](/sdk-ref/platform/enums/authmethodtype)

The authentication method used for the authentication action (e.g. `password`, `mobile_biometric`, `oidc`).

### loginOrigin

• `Optional` **loginOrigin**: `string`

The origin the user logged in from, such as the URL of the site or app where the login took place.