OAuthClientAuthHandler

OAuthClientAuthHandler

Abstract class for handling client authentication in OAuth-based operations. When request-body client authentication is used, only application/json and application/x-www-form-urlencoded content types for HTTP methods that support request bodies are supported.

Constructor

new OAuthClientAuthHandler(options)

Instantiates an OAuth client authentication handler.

Parameters:
Name Type Description
options

The OAuth Client Auth Handler instance options. Passing an ClientAuthentication directly is @DEPRECATED.

Members

RETRY_CONFIG

Retry config for Auth-related requests.

Methods

applyClientAuthenticationOptions(opts, bearerToken)

Applies client authentication on the OAuth request's headers or POST body but does not process the request.

Parameters:
Name Type Description
opts

The GaxiosOptions whose headers or data are to be modified depending on the client authentication mechanism to be used.

bearerToken

The optional bearer token to use for authentication. When this is used, no client authentication credentials are needed.

injectAuthenticatedHeaders(opts, bearerToken)

Applies client authentication on the request's header if either basic authentication or bearer token authentication is selected.

Parameters:
Name Type Description
opts

The GaxiosOptions whose headers or data are to be modified depending on the client authentication mechanism to be used.

bearerToken

The optional bearer token to use for authentication. When this is used, no client authentication credentials are needed.

injectAuthenticatedRequestBody(opts)

Applies client authentication on the request's body if request-body client authentication is selected.

Parameters:
Name Type Description
opts

The GaxiosOptions whose headers or data are to be modified depending on the client authentication mechanism to be used.