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
- (RECOMMENDED) the discovery function that discovers the OAuth 2.0 Authorization Server metadata using the Authorization Server's Issuer Identifier, or
- The Configuration constructor if the OAuth 2.0 Authorization Server metadata is known upfront
(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)
▸ new Configuration(server
, clientId
, metadata
?, clientAuthentication
?): Configuration
Parameter | Type | Description |
---|---|---|
server |
ServerMetadata |
Authorization Server Metadata |
clientId |
string |
Client Identifier at the Authorization Server |
metadata ? |
string | Partial <ClientMetadata > |
Client Metadata, when a string is passed in it is a shorthand for passing just ClientMetadata.client_secret. |
clientAuthentication ? |
ClientAuth |
Implementation of the Client's Authentication Method at the Authorization Server. |