API: oauth
Source:
security/oauth.ts
Configuration structure for the OAuth client.
Classes
OAuthClient
A client class for fetching OAuth access tokens.
It uses the HTTP client to send a POST request with client credentials
to the specified token endpoint.
Methods
getToken
getToken ()voidExecutes the OAuth token request and returns the parsed response.
The request uses the client credentials grant type (default) and
sends credentials as URL-encoded parameters in the body.
@returns A parsed JSON object containing the OAuth token (e.g., { access_token: string, expires_in: number, ... }).
@throws {Error} If the HTTP status code is not 200.