CustomAuthenticator and CustomRequestor for API authentication in Low Code Source Connectors


The user is inquiring about adding CustomAuthenticator and CustomRequestor for an API with unique authentication requirements in a Low Code Source Connector. They are unsure if they need to build a custom source connector using the Python CDK due to limitations in the YAML configuration.


(CC: <@U02T7NVJ6A3> if you’d rather respond here)
To: <#C027KKE4BCZ|help-connector-development>
I just realized that while I need a CustomAuthenticator (and may also need a CustomRequestor… though I’m finalizing the design at the moment) for an API that uses really really weird authentication, I can’t just “add that to the YAML” because low code custom Source Connectors don’t show any authentication in the YAML… am I stuck with building custom source connector using the Python CDK? or is there something about that YAML in the Low Code model that I’m not understanding?

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want to access the original thread.

Join the conversation on Slack

["customauthenticator", "customrequestor", "api-authentication", "low-code", "source-connector", "python-cdk", "yaml-configuration"]

You’re correct that some APIs require complex custom authentication schemes involving signing requests or doing multiple requests to authenticate. In these cases, it’s required to use the low-code CDK or Python CDK. For custom authentication, you can use a CustomAuthenticator object in your YAML file. This object allows you to specify a fully-qualified name of the class that will be implementing the custom authentication strategy. This class has to be a subclass of DeclarativeAuthenticator. You can also set parameters that are inherited to all children. Here’s an example: yaml class_name: "source_railz.components.ShortLivedTokenAuthenticator" $parameters: object Source If you find yourself needing to build a custom component, you can create a feature request issue. If appropriate, Airbyte will add it directly to the framework or you can submit a PR. Any built-in components can be overloaded by a custom Python class. For instance, to create a custom component, define a new class in a new file in the connector’s module. The class must implement the interface of the component it is replacing. The class must also be a dataclass where each field represents an argument to configure from the yaml file, and an InitVar named parameters. This class can then be referred from the yaml file by specifying the type of custom component and using its fully qualified class name. Source If you’re still having trouble, you can refer to the Getting Started tutorial or the video tutorial for a step-by-step guide on using the low-code framework to build a REST API Source connector.

<@U06CC9J0T42> if you need to use a CustomAuthenticator, you can still implement your connector with low-code YAML, but you will not be able to do this in the Builder UI, since that does not support custom components at the moment.

You will need to create a custom authenticator component, and iterate on your connector using command line / text editors. Here are some references to help:
• <Advanced Topics | Airbyte Documentation on custom components>
• <|Tutorial on building a low-code connector manually, i.e. not in the builder UI>
• <airbyte/airbyte-integrations/connectors/source-commercetools/source_commercetools/manifest.yaml at 5c6f4f217451b2f367c8e6dbc6b51de73803f0b1 · airbytehq/airbyte · GitHub of a low-code connector with a custom authenticator>