getOrCreateDynamicClient
Agent Runtimes / identity/dcr / getOrCreateDynamicClient
Function: getOrCreateDynamicClient()
getOrCreateDynamicClient(
issuerUrl,options):Promise<DynamicClient>
Defined in: identity/dcr.ts:340
Get or create a dynamic client for an OAuth provider
This is the main entry point for DCR. It:
- Checks if we already have a registered client for this issuer
- If not, discovers the authorization server metadata
- If DCR is supported, registers a new client
- Stores the client for future use
Parameters
issuerUrl
string
The OAuth provider's issuer URL
options
Registration options
clientName?
string
Application name
forceNew?
boolean
Force re-registration even if client exists
initialAccessToken?
string
Optional initial access token for protected endpoints
redirectUris
string[]
Redirect URIs
scopes?
string[]
Requested scopes
Returns
Promise<DynamicClient>
The dynamic client information
Throws
Error if DCR is not supported or registration fails