Skip to content

Connectum API Reference / @connectum/auth / AuthContext

Interface: AuthContext

Defined in: packages/auth/src/types.ts:22

Authenticated user context

Represents the result of authentication. Set by auth interceptor, accessible via getAuthContext() in handlers and downstream interceptors.

Properties

claims

readonly claims: Readonly<Record<string, unknown>>

Defined in: packages/auth/src/types.ts:32

Raw claims from the credential (JWT claims, API key metadata, etc.)


expiresAt?

readonly optional expiresAt: Date

Defined in: packages/auth/src/types.ts:36

Credential expiration time


name?

readonly optional name: string

Defined in: packages/auth/src/types.ts:26

Human-readable display name


roles

readonly roles: readonly string[]

Defined in: packages/auth/src/types.ts:28

Assigned roles (e.g., ["admin", "user"])


scopes

readonly scopes: readonly string[]

Defined in: packages/auth/src/types.ts:30

Granted scopes (e.g., ["read", "write"])


subject

readonly subject: string

Defined in: packages/auth/src/types.ts:24

Authenticated subject identifier (user ID, service account, etc.)


type

readonly type: string

Defined in: packages/auth/src/types.ts:34

Credential type identifier (e.g., "jwt", "api-key", "mtls")