Tom De Kooning
10/21/2024, 11:13 AMuser
10/21/2024, 11:15 AMSessionTokenAuthenticator
object in your YAML file. This object describes the request to perform to obtain a session token to perform data requests. The response body is expected to be a JSON object with a session token property. Here is an example of how you can define it in your YAML file: yaml login_requester: type: HttpRequester url_base: "<https://my_api.com>" path: "/login" authenticator: type: BasicHttpAuthenticator username: "{{ config.username }}" password: "{{ config.password }}" session_token_path: - "access_token"
In the above example, session_token_path
is the path in the response body returned from the login requester to the session token. You can replace "access_token"
with the actual path to your session token in the response body. Once you have the session token, you can use it as a Bearer token for authenticating your requests. You can use the BearerAuthenticator
object for this purpose. Here is an example: yaml authenticator: type: BearerAuthenticator api_token: "{{ config['api_key'] }}"
In the above example, api_token
is the token to inject as request header for authenticating with the API. You can replace "{{ config['api_key'] }}"
with the actual session token that you obtained. For more information, you can refer to the [Airbyte documentation](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/SessionTokenAuthenticator) on SessionTokenAuthenticator
and BearerAuthenticator
. Please note that the actual implementation may vary depending on the specifics of your API and how it handles session tokens and bearer tokens.Tom De Kooning
10/21/2024, 11:22 AMuser
10/21/2024, 11:22 AM/api/session
response looks like {"id":"<session-token-value>"}
, so the value here would simply be id
. This indicates that the session token is stored in the response body of the session token retrieval request. However, for a more specific answer related to your use case, you may need to refer to the documentation of the specific API you are working with or the specific connector's documentation in Airbyte. For more information, you can refer to the following sources: - [Session Token Authenticator](https://docs.airbyte.com/connector-development/connector-builder-ui/authentication#session-token) - [Connector Builder UI Authentication](https://docs.airbyte.com/connector-development/connector-builder-ui/authentication#configuration) - [SessionTokenRequestBearerAuthenticator](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/SessionTokenRequestBearerAuthenticator)Tom De Kooning
10/21/2024, 11:23 AMuser
10/21/2024, 11:23 AMuser
10/21/2024, 11:24 AMlogin_requester
and session_token_path
. The login_requester
describes the request to perform to obtain a session token, and the session_token_path
is the path in the response body from the login requester to the session token. Here is an example of how it might look in your .YAML file: yaml login_requester: type: HttpRequester url_base: "<https://my_api.com>" path: "/login" authenticator: type: BasicHttpAuthenticator username: "{{ config.username }}" password: "{{ config.password }}" session_token_path: - "access_token"
In this example, the connector will make a request to <https://my_api.com/login>
with the provided username and password, and then extract the session token from the access_token
field in the response. For more information, you can refer to the [SessionTokenAuthenticator documentation](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/SessionTokenAuthenticator).