Kiet Luu (Ken)
08/15/2025, 5:34 PMkapa.ai
08/15/2025, 5:35 PM{"Content-Type": "application/x-www-form-urlencoded"}, you should use the refresh_request_headers property in the OAuthAuthenticator section of your YAML manifest. This property allows you to specify custom headers for the token refresh (access token) request. Here’s an example snippet: yaml authenticator: type: OAuthAuthenticator # ... other required OAuth properties ... refresh_request_headers: Content-Type: "application/x-www-form-urlencoded" This configuration ensures that when Airbyte sends the request to obtain or refresh the access token, it will include the Content-Type: application/x-www-form-urlencoded header as required by many OAuth 2.0 token endpoints. For more details and additional properties you can set in the OAuthAuthenticator, see the official documentation: [OAuthAuthenticator Reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator)Kiet Luu (Ken)
08/15/2025, 5:39 PMStreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 1]"
when i tried to use this
access_token_headers:
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {{ (client_id ~ ':' ~ client_secret) | b64encode }}
access_token_params: |
{
{
"client_id": "{{ config.client_id }}",
"client_secret": "{{ config.client_secret }}",
"code": "{{ auth_code_value }}",
"grant_type": "authorization_code",
"redirect_uri": "https://cloud.airbyte.com/auth_flow"
}
scope: "task: read"kapa.ai
08/15/2025, 5:39 PMkapa.ai
08/15/2025, 5:40 PMInternal Server Error: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') suggests that the response from the token endpoint is not valid JSON—it's likely an HTML error page (often starting with <html>), which usually means the request was not formatted as the server expected. Issues in your configuration: 1. YAML Structure: In Airbyte's declarative OAuth spec, access_token_headers and access_token_params are not nested under each other—they are siblings under the OAuth configuration. Also, access_token_params should be a YAML object, not a string or block. 2. Content-Type and Parameter Format: If you set Content-Type: application/x-www-form-urlencoded, the parameters must be sent as form data, not as a JSON object. Airbyte's declarative OAuth supports this by default, but you must provide the parameters as a YAML map, not as a stringified JSON. Correct Example: yaml access_token_url: https://yourconnectorservice.com/oauth/token access_token_headers: Content-Type: application/x-www-form-urlencoded Authorization: Basic {{ (client_id_value ~ ':' ~ client_secret_value) | b64encode }} access_token_params: client_id: "{{ client_id_value }}" client_secret: "{{ client_secret_value }}" code: "{{ auth_code_value }}" grant_type: "authorization_code" redirect_uri: "https://cloud.airbyte.com/auth_flow" scope: "task: read" Key Points: - access_token_params should be a YAML map, not a string or block. - Do not use double curly braces inside a YAML block for the whole object—use them only for values. - Make sure the endpoint expects form-encoded data if you set the Content-Type header accordingly. References: - [Advanced Case: access token url query parameters should be JSON-encoded](https://docs.airbyte.com/platform/connector-development/config-based/advanced-topics/oauth#advanced-case-access-token-url-query-parameters-should-be-json-encoded) - [OAuthAuthenticator Reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/OAuthAuthenticator) If you still get an HTML error, double-check the endpoint URL and required parameters, and ensure your client credentials are correct. If the endpoint expects JSON, you may need to adjust the Content-Type and parameter formatting accordingly.Kiet Luu (Ken)
08/15/2025, 5:47 PMredirect_uri with an authorization code as a query parameter.
Name Description code Authorization code for subsequent access tokens state state parameter passed in the first step Third Step
To exchange the authorization code for an access token, make a POST request to https://ticktick.com/oauth/token with the following parameters(Content-Type: application/x-www-form-urlencoded):
Name Description client_id The username is located in the HEADER using the Basic Auth authentication method client_secret The password is located in the HEADER using the Basic Auth authentication method code The code obtained in the second step grant_type grant type, now only authorization_code scope spaces-separated permission scope. The currently available scopes are tasks: write, tasks: read redirect_uri user-configured redirect url Access_token for openapi request authentication in the request response
{
...
"access_token": "access token value"
...
}
Request OpenAPI
Set Authorization in the header, the value is Bearer access token valuekapa.ai
08/15/2025, 5:48 PMkapa.ai
08/15/2025, 5:48 PM