Oauth2clientauth Extension
contrib, k8s
Maintainers: @pavankrish123
Source: opentelemetry-collector-contrib
Overview
This extension provides OAuth2 Client Credentials flow authenticator for HTTP and gRPC based exporters. The extension fetches and refreshes the token after expiry automatically. For further details about OAuth2 Client Credentials flow (2-legged workflow) refer https://datatracker.ietf.org/doc/html/rfc6749#section-4.4. The authenticator type has to be set tooauth2client.
Configuration
- token_url - The resource serverâs token endpoint URLs.
- client_id - The client identifier issued to the client.
- grant_type - Optional OAuth2 grant type to use. It can be one of âclient_credentialsâ or âurn:ietf:params:oauth:grant-type:jwt-bearerâ and defaults to âclient_credentialsâ
- client_id_file - The file path to retrieve the client identifier issued to the client.
The extension reads this file and updates the client ID used whenever it needs to issue a new token. This enables dynamically changing the client credentials by modifying the file contents when, for example, they need to rotate.
This setting takes precedence overclient_id. - client_secret - The secret string associated with above identifier. This is required when grant_type is âclient_credentialsâ
- client_secret_file - The file path to retrieve the secret string associated with above identifier.
The extension reads this file and updates the client secret used whenever it needs to issue a new token. This enables dynamically changing the client credentials by modifying the file contents when, for example, they need to rotate.
This setting takes precedence overclient_secret. - client_certificate_key - The private key used to sign the jwt assertion used for RFC7523. This is required when grant_type is âurn:ietf:params:oauth:grant-type:jwt-bearerâ
- client_certificate_key_file - The file path to retrieve the secret string associated with above identifier.
The extension reads this file and updates the client key used whenever it needs to issue a new token. This enables dynamically changing the credentials by modifying the file contents when, for example, they need to rotate.
This setting takes precedence overclient_certificate_key. - client_certificate_key_id - Optional kid used to sign the jwt assertion used for RFC7523.
- signature_algorithm - Optional RSA algorithm used to sign jwt assertion used for RFC7523 and defaults to âRS256â.
- iss - Optional client identifier used added to jwt assertion used for RFC7523 and defaults to âclient_idâ.
- audience: - Optional intended audience of the jwt assertion used for RFC7523 and defaults to âtoken_urlâ.
- claims: - Optional extra claims to be added to jwt assertion used for RFC7523.
- endpoint_params - Additional parameters that are sent to the token endpoint.
- scopes - Optional optional requested permissions associated for the client.
- timeout - Optional specifies the timeout on the underlying client to authorization server for fetching the tokens (initial and while refreshing). This is optional and not setting this configuration implies there is no timeout on the client.
- expiry_buffer - Optional Specifies the time buffer to refresh the access token before it expires, preventing authentication failures due to token expiration. The default value is 5m.
Configuration
Example Configuration
Last generated: 2026-04-13