Class: Configuration

August 29, 2025 ยท View on GitHub

๐Ÿ’— Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


Configuration is an abstraction over the OAuth 2.0 Authorization Server metadata and OAuth 2.0 Client metadata

Configuration instances are obtained either through

Examples

(RECOMMENDED) Setting up a Configuration with a Server Metadata discovery step

let server!: URL
let clientId!: string
let clientSecret!: string | undefined

let config = await client.discovery(server, clientId, clientSecret)

Setting up a Configuration with a constructor

let server!: client.ServerMetadata
let clientId!: string
let clientSecret!: string | undefined

let config = new client.Configuration(server, clientId, clientSecret)

Implements

Constructors

Constructor

โ–ธ new Configuration(server, clientId, metadata?, clientAuthentication?): Configuration

Parameters

ParameterTypeDescription
serverServerMetadataAuthorization Server Metadata
clientIdstringClient Identifier at the Authorization Server
metadata?string | Partial<ClientMetadata>Client Metadata, when a string is passed it is a shorthand for passing just ClientMetadata.client_secret.
clientAuthentication?ClientAuthImplementation of the Client's Authentication Method at the Authorization Server. Default is ClientSecretPost using the ClientMetadata.client_secret.

Returns

Configuration