Is it possible to use Airbyte Cloud with a client ...
# ask-ai
d
Is it possible to use Airbyte Cloud with a client connector authorization flow and a custom authorization header that base64 encodes client_id and client_secret separated by a colon? Can I do this through the declarative auth YAML? Can I create a custom Docker source and import that into Airbyte Cloud?
k
Yes, it is possible to configure a connector in Airbyte using a declarative OAuth 2.0 flow where the client credentials are sent as a custom authorization header, base64-encoded as
client_id:client_secret
. The declarative OAuth configuration allows you to specify custom headers and even encode values as needed. For example, you can define the
access_token_headers
in your YAML like this:
Copy code
yaml access_token_headers:   Authorization: "{{ (client_id_value ~ ':' ~ client_secret_value) | b64encode }}"
This will set the
Authorization
header to the base64-encoded value of
client_id:client_secret
during the token exchange step, which matches your requirement. This approach is documented as an advanced case in the Airbyte documentation, showing how to move the client secret from a query parameter to a header and how to encode it in base64 using Jinja templating in the YAML spec. You can see the example here:
Copy code
yaml access_token_headers:   SECRETHEADER: "{{ (client_id_value ~ ':' ~ client_secret_value) | b64encode }}"
You would replace
SECRETHEADER
with
Authorization
or whatever header your API expects. [Advanced Case: client secret is a request header not a query parameter](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#advanced-case-client-secret-is-a-request-header-not-a-query-parameter) Regarding Airbyte Cloud and custom connectors: While Airbyte Cloud supports declarative OAuth flows, the documentation does not explicitly state whether you can directly upload or import a custom Docker source into Airbyte Cloud. Typically, Airbyte Cloud supports connectors that are available in the Airbyte Cloud catalog. If you need to use a custom connector, you may need to reach out to Airbyte support or follow their process for requesting new connectors or custom deployments. The knowledge sources do not provide a definitive answer on importing custom Docker sources into Airbyte Cloud. Summary: - Declarative YAML can handle your custom OAuth header and encoding needs. - Airbyte Cloud supports declarative OAuth, but importing custom Docker sources is not explicitly documented in the provided sources. If you need to use a custom connector in Airbyte Cloud, you may need to contact Airbyte support for guidance.
d
@kapa.ai, how would I configure OAuth via client_credentials with the custom Authorization header in declarative YAML?
k
A message from kapa.ai
To configure OAuth via the
client_credentials
grant type with a custom
Authorization
header (base64-encoded
client_id:client_secret
) in Airbyte's declarative YAML, you can use the
access_token_headers
field in your OAuth configuration. The Airbyte documentation provides an example of this approach, where you use Jinja templating to encode the credentials and set them as a header. Here’s how you can do it:
Copy code
yaml access_token_url: >-   https://yourconnectorservice.com/oauth/token access_token_headers:   Authorization: "Basic {{ (client_id_value ~ ':' ~ client_secret_value) | b64encode }}"
- The
access_token_url
is the endpoint for obtaining the access token. - The
Authorization
header is set to
Basic <base64(client_id:client_secret)>
using Jinja templating and the
b64encode
filter. This pattern is explicitly documented as an advanced case for handling scenarios where the client secret must be sent as a header, and it supports base64 encoding directly in the YAML configuration. You can adapt this to your connector’s manifest as needed [Advanced Case: client secret is a request header not a query parameter](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#advanced-case-client-secret-is-a-request-header-not-a-query-parameter). Note: - Make sure to set the
grant_type
to
client_credentials
in your request body or parameters as required by your API. - The rest of your OAuth configuration (such as token extraction, scopes, etc.) should follow the standard declarative OAuth pattern. If you need a full manifest example or further details, let me know!
d
@kapa.ai I've seen those documents before and haven't been able to get them to work. I've added the Authorization header and a test header to access_token_headers in the spec section as seen in the previously linked documentation.
Copy code
spec:
  type: Spec
  connection_specification:
    type: object
    $schema: http://json-schema.org/draft-07/schema#
    required:
      - client_id
      - client_secret
      - region
    properties:
      region:
        type: string
        description: The region where your Cvent account is hosted
        enum:
          - north_america
          - europe
        title: Region
        default: north_america
      client_id:
        type: string
        description: Your Cvent application's client ID
        title: Client ID
        airbyte_secret: true
      start_date:
        type: string
        description: Start date for data replication in YYYY-MM-DD format
        title: Start Date
        format: date
        pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
        examples:
          - "2023-01-01"
      api_version:
        type: string
        description: The Cvent API version to use
        title: API Version
        default: ea
        examples:
          - ea
      client_secret:
        type: string
        description: Your Cvent application's client secret
        title: Client Secret
        airbyte_secret: true
    access_token_headers:
      TESTHEADER: test_value
      Authorization: >-
        Basic {{ (config['client_id'] ~ ':' ~ config['client_secret']) |
        b64encode }}
    additionalProperties: true
However, the request does not include any custom headers.
Copy code
{
  "url": "https://api-platform.cvent.com/ea/oauth2/token",
  "body": "grant_type=client_credentials&client_id=****&client_secret=****",
  "headers": {
    "User-Agent": "python-requests/2.32.4",
    "Accept-Encoding": "gzip, deflate",
    "Accept": "*/*",
    "Connection": "keep-alive",
    "Content-Length": "139",
    "Content-Type": "application/x-www-form-urlencoded"
  },
  "http_method": "POST"
}
The issue from what I can tell is that there's no access token screen when connecting via client credentials which is why
access_token_headers
doesn't add anything to the client credential token request.
k
A message from kapa.ai
Thank you for your detailed description and configuration example. Based on the knowledge sources provided, here’s what can be confirmed: ### Declarative OAuth and
access_token_headers
Support The Airbyte documentation does show that you can set custom headers (including a base64-encoded
Authorization
header) for the access token request using the
access_token_headers
field in the OAuth configuration. The documented examples place
access_token_headers
within the OAuth configuration section, not directly under the
spec
or
connection_specification
fields. For example:
Copy code
yaml access_token_url: >-   https://yourconnectorservice.com/oauth/token access_token_headers:   Authorization: "{{ (client_id_value ~ ':' ~ client_secret_value) | b64encode }}"
[Advanced Case: client secret is a request header not a query parameter](https://docs.airbyte.com/platform/next/connector-development/config-based/advanced-topics/oauth#advanced-case-client-secret-is-a-request-header-not-a-query-parameter) ### Where to Place
access_token_headers
The knowledge sources do not show
access_token_headers
as a property of the
spec
or
connection_specification
object. Instead, it is part of the OAuth configuration block, which is typically under
advanced_auth.oauth_config_specification
in your connector manifest, not in the JSON schema for user input. ### Why Your Headers Aren’t Applied Based on the documentation, if you place
access_token_headers
under
spec
or
connection_specification
, Airbyte will not recognize it as part of the OAuth flow. This is likely why your custom headers are not being sent in the token request. ### Correct Placement Example You should define your OAuth configuration in the manifest (YAML) under the
advanced_auth
section, like this:
Copy code
yaml advanced_auth:   auth_flow_type: oauth2.0   oauth_config_specification:     complete_oauth_output_specification:       # ... your output spec ...     complete_oauth_server_input_specification:       # ... your input spec ...     oauth_user_input_from_connector_config_specification:       # ... your user input spec ...     # The OAuth flow configuration:     access_token_url: https://api-platform.cvent.com/ea/oauth2/token     access_token_headers:       Authorization: "Basic {{ (config['client_id'] ~ ':' ~ config['client_secret']) | b64encode }}"       TESTHEADER: test_value     access_token_params:       grant_type: client_credentials
(You may need to adjust the variable references to match your config structure.) ### Limitation The knowledge sources do not provide a full, working example for the
client_credentials
flow with custom headers in Airbyte Cloud, nor do they confirm if the UI for Airbyte Cloud supports triggering this flow with a custom header out-of-the-box. There is also a [known issue](https://github.com/airbytehq/airbyte/issues/46903) where the
OAuthAuthenticator
expects a
refresh_token
even for
client_credentials
flows, which may affect your use case. --- Summary: -
access_token_headers
must be placed in the OAuth configuration, not in the user input schema. - The Airbyte UI may not expose a consent screen for
client_credentials
, but the declarative YAML should still apply the headers if configured correctly in the manifest. - There may be a platform limitation or bug affecting
client_credentials
flows with custom headers. If you continue to experience issues, it may be due to the current limitations or bugs in Airbyte’s handling of the
client_credentials
flow, as referenced in the open GitHub issue. The knowledge sources do not provide a workaround for this specific scenario.