<@U04S8PLJWMT> trying to build a custom source, wi...
# replication-ask-ai
s
@kapa.ai trying to build a custom source, with Authenticator: Session Token Authenticator, this returns a .json with Data Request Authentication Bearer Authenticator, but getting this error:
Unauthorized. Please ensure you are authenticated correctly.
'GET' request to '*********' failed with status code '401' and error message: 'Unauthorized'. Request (body): 'None'. Response (body): '{'timestamp': '2026-03-12T15:45:57.791+00:00', 'status': 401, 'error': 'Unauthorized', 'path': '/api/*****/'}'.
seems like the bearer token is not getting included in the header
k
Based on the knowledge sources, this is a known issue when using a Session Token Authenticator that returns a bearer token. The problem is likely in how the token is being injected into outgoing data requests. How to Fix When your Session Token Authenticator returns a token that needs to be sent as
Authorization: Bearer
token, you need to make sure the Data Request Authentication is configured correctly. Option 1: Use "Bearer" mode in Session Token config In the Connector Builder UI, when configuring the Session Token Authenticator's data request authentication: • Choose
Bearer
if your session token needs to be sent as a standard Bearer token. [Session Token Config] Option 2: Manually set the Authorization header in YAML If the Bearer prefix is not being prepended automatically (a known issue), you can work around it by not using the automatic injection and instead manually adding a request header. From a similar community case: > Disable the automatic injection checkbox, then add a Request Header with: > • Key:
Authorization
> • Value: `Bearer {{ stream_partition.
<your_token_field>
}}` [Bearer Token Header Fix] Option 3: Use
ApiKeyAuthenticator
in YAML
You can explicitly set the
Authorization
header with the
Bearer
prefix using the `ApiKeyAuthenticator`:
Copy code
authenticator:
  type: "ApiKeyAuthenticator"
  header: "Authorization"
  api_token: "Bearer {{ <your_token_variable> }}"
[ApiKeyAuthenticator Docs] ------------------------- Key takeaway: The 401 error is most likely because the
Bearer
prefix is missing from the
Authorization
header. Make sure your Data Request Authentication is set to Bearer mode in the Session Token Authenticator configuration, or manually construct the header as shown above. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
s
@kapa.ai is this a known issue for all CDK versions or has this been fixed in newer releases?
k
The knowledge sources I have access to don't contain specific information about whether this Bearer token prefix issue has been fixed in particular CDK versions or when it was introduced/resolved across releases. The documentation I can reference covers platform versions 1.6, 1.7, 1.8, and 2.0, and the
SessionTokenRequestApiKeyAuthenticator
configuration appears consistent across all of them — with the
api_token
field supporting templates like
Bearer {{ session_token }}
in all versions. [Session Token Auth 1.6; Session Token Auth 2.0] For a definitive answer on whether this is a known bug and its fix status, I'd recommend: 1. Checking the Airbyte GitHub issues directly for related reports. 2. Asking in the Airbyte Slack community, where the core team is active. In the meantime, the workaround of explicitly setting
api_token: "Bearer {{ session_token }}"
in your YAML configuration should work reliably across all the documented versions. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.