Skip to main content

Class: OAuthAuthCode

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:15

A short-lived authorization code with its bound PKCE challenge.

The primary key is the code's SHA-256 hash, never the code itself: a code travels through a browser redirect and a client's URL bar, so storing it in plaintext would make a database dump yield replayable codes.

Extends

  • Model

Constructors

Constructor

new OAuthAuthCode(values?, options?): OAuthAuthCode

Defined in: node_modules/.pnpm/sequelize-typescript@2.1.6_@types+node@26.1.1_@types+validator@13.15.10_reflect-metadat_4b56ff65ccbbb483836c71bec8c3693e/node_modules/sequelize-typescript/dist/model/model/model.d.ts:21

Parameters

ParameterType
values?Optional<any, string>
options?BuildOptions

Returns

OAuthAuthCode

Inherited from

Model.constructor

Properties

clientId

clientId: string

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:29

The client_id the code was issued to.


codeChallenge

codeChallenge: string

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:43

The PKCE code_challenge (S256) bound to this code.


codeHash

codeHash: string

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:22

SHA-256 hash (hex) of the authorization code.


expiresAt

expiresAt: Date

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:64

Instant after which the code is invalid.


redirectUri

redirectUri: string

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:36

The redirect URI the code was issued for (must match on exchange).


scopes

scopes: string[]

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:50

The scopes granted to this code.


subject

subject: string

Defined in: packages/auth-postgresdb/src/models/OAuthAuthCode.ts:57

The authenticated end-user subject identifier.