I'm using the connector builder for a new connecto...
# ask-ai
a
I'm using the connector builder for a new connector. Its using Oauth2 authentication, where I need to request for a new access token using the client id + client secret + refresh token. I've properly configured it. However, once received a valid access token, I need to pass it in a custom header (x-amz-access-token) in the main request (not the standard bearer one). How to do this?
k
The OAuth 2 docs for the Connector Builder describe how to get and refresh the access token, but they do not document any option to change the header used to send that token on the main data requests (only the standard
Authorization: Bearer <token>
pattern is shown).[[OAuth 2 builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/authentication#oauth-2)][[Square example](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/authentication#example-4)] The ability to inject custom headers during the token exchange itself (e.g., putting the client secret in a header instead of a query param) exists in the Declarative OAuth / manifest-based connectors via
access_token_headers
.[[Client secret header](https://docs.airbyte.com/platform/connector-development/config-based/advanced-topics/oauth#advanced-case-client-secret-is-a-request-header-not-a-query-parameter)] But the provided docs don’t show any way to: - Take the obtained access token, and - Automatically place it into a non‑standard header like
x-amz-access-token
on all subsequent resource requests in the Connector Builder UI. Because this is not documented, I can’t reliably tell you that it’s supported in the Connector Builder, nor give you a supported configuration snippet for it. If you absolutely need
x-amz-access-token
instead of
Authorization: Bearer ...
, the docs currently only show enough flexibility in the config‑based / declarative connector flow (via manifests), not in the low‑code Connector Builder UI.[[OAuth 2 builder](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/authentication#oauth-2)][[Declarative OAuth examples](https://docs.airbyte.com/platform/connector-development/config-based/advanced-topics/oauth#advanced-case-client-secret-is-a-request-header-not-a-query-parameter)] So, based on the available documentation: - There is no documented way today in the Connector Builder UI to remap the OAuth access token into a custom header like
x-amz-access-token
on the main requests. - To achieve this behavior, you would likely need to: - Use a config‑based declarative connector (manifest) where you can control request headers more explicitly, or - Implement a custom (Python/Java) connector. If you’d like, share which Airbyte platform version you’re on and whether you can use manifest‑based connectors; then we can look at how you might express
x-amz-access-token
in a declarative manifest based on the existing OAuth examples.
a
is the result of the authentication request available in any jinja variable?
@kapa.ai
k
Sorry @Alejo Buxeres, I'm not sure what you mean. Please try again. 👋
a
is the result of the authentication request available in any jinja variable? @kapa.ai
k
A message from kapa.ai
The provided docs do not mention any Jinja variable that contains the result of the OAuth authentication / token refresh response. - The
OAuthAuthenticator
component only documents fields like
client_id
,
client_secret
,
refresh_token
,
access_token_name
,
access_token_value
,
token_refresh_endpoint
, etc., and says these can be populated from the
config
object via Jinja (e.g.
{{ config['client_id'] }}
).[[OAuthAuthenticator ref](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator)] - Declarative OAuth examples only describe how to map values from the OAuth response back into the connector config via
path_in_oauth_response
and
path_in_connector_config
, but do not expose the raw OAuth response as a separate Jinja context; you still only reference
config
afterwards.[[Declarative OAuth cases](https://docs.airbyte.com/platform/connector-development/config-based/advanced-topics/oauth#common-use-cases-and-examples)] So, based on the current documentation, the only documented Jinja context is
config[...]
(plus other standard variables like
stream_slice
, etc., not the auth response itself). There is no documented Jinja variable that directly exposes the full authentication/refresh response.
a
can I refer to another header when defining request headers ? @kapa.ai
k
A message from kapa.ai
Based on the docs you’ve shared, request headers are defined as simple key–value pairs in
request_headers
(or via
RequestOption
), and values can be interpolated from things like
config
using Jinja. [[Request options provider](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/request-options#request-options-provider)] However, none of the documents indicate that you can: - Read one header’s value, and - Reuse or reference it while defining another header (e.g.,
header_b: {{ headers['header_a'] }}
). The only documented sources for interpolation are the usual contexts (e.g.,
config
, not previously built headers). [[Request options provider](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/request-options#request-options-provider)] So, from the available documentation, there is no explicit support for referring to another header’s value when defining request headers.