<@U04S8PLJWMT> how can I replicate oauth1 in a cus...
# replication-ask-ai
i
@kapa.ai how can I replicate oauth1 in a custom connector with a custom authenticator?
k
You can replicate OAuth1 in a custom connector by implementing your own authenticator class and wiring it into your connector, instead of relying on the built‑in OAuth2 support. From the Python CDK side, the key idea is: 1. Use an OAuth1 object (e.g., from
requests_oauthlib
) as the authenticator
Airbyte’s HTTP streams accept any object that behaves like a
requests
authenticator. In the forum example, they construct an
OAuth1
instance and pass it directly as the
authenticator
for the stream:
Copy code
from requests_oauthlib import OAuth1

   oauth = OAuth1(
       client_key=config["consumer_key"],
       client_secret=config["consumer_secret"],
       resource_owner_key=config["access_token"],
       resource_owner_secret=config["token_secret"],
   )

   return [MyStream(authenticator=oauth)]
This works because authenticators can extend
requests.auth.AuthBase
, and
OAuth1
already does that. [Custom OAuth1] 2. Wrap OAuth1 in your own custom authenticator (optional but common) If you want a custom authenticator (e.g., to add extra logic, logging, or config handling), you can create a small class that wraps the
OAuth1
object and still behaves like a
requests
authenticator. The forum guidance shows the pattern of defining a custom
AuthBase
subclass and passing it into your stream. [Intuit OAuth forum] 3. For low‑code (YAML) connectors: use
CustomAuthenticator
For config‑based / low‑code connectors, you can’t use OAuth1 out of the box, but you can define a
CustomAuthenticator
that points to a Python class implementing your OAuth1 logic. The YAML references a fully‑qualified class name that subclasses `DeclarativeAuthenticator`:
Copy code
authenticator:
     type: CustomAuthenticator
     class_name: "your_package.components.OAuth1Authenticator"
     $parameters: {}
The class itself (in your connector’s Python module) implements the custom OAuth1 signing and is then used by the low‑code framework. [CustomAuthenticator] In summary: implement OAuth1 by either (a) directly passing an
OAuth1
object as the
authenticator
to your HTTP stream, or (b) wrapping it in a custom authenticator class and, for low‑code connectors, exposing that via
CustomAuthenticator
in the manifest YAML. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.