Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 2.46 KB

discovery.md

File metadata and controls

40 lines (28 loc) · 2.46 KB

Function: discovery()

💗 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.


discovery(server, clientId, metadata?, clientAuthentication?, options?): Promise<Configuration>

Performs Authorization Server Metadata discovery and returns a Configuration with the discovered Authorization Server metadata.

Passing the Authorization Server's Issuer Identifier to this method is the RECOMMENDED method of client configuration.

This has the same effect as calling the Configuration constructor except that the server metadata is discovered from its own Authorization Server Metadata discovery document.

Note: This method also accepts a URL pointing directly to the Authorization Server's discovery document, doing so is merely a shorthand for using fetch and passing the discovered JSON metadata (as ServerMetadata) into the Configuration constructor. Doing so is NOT RECOMMENDED as it disables the ServerMetadata.issuer validation.

Parameters

Parameter Type Description
server URL URL representation of the Authorization Server's Issuer Identifier
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 -
options? DiscoveryRequestOptions

Returns

Promise<Configuration>