1
0
mirror of synced 2026-01-26 13:01:49 -05:00
Files
airbyte/docs/connector-development/config-based/authentication.md
Alexandre Girard 288c3cabad Tutorial and documentation for config-based connectors (#15027)
* 5-step tutorial

* move

* tiny bit of editing

* Update tutorial

* update docs

* reset

* move files

* record selector, request options, and more links

* update

* update

* connector definition

* link

* links

* update example

* footnote

* typo

* document string interpolation

* note on string interpolation

* update

* fix code sample

* fix

* update sample

* fix

* use the actual config

* Update as per comments

* write as yaml

* typo

* Clarify options overloading

* clarify that docker must be running

* remove extra footnote

* use venv directly

* Apply suggestions from code review

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>

* signup instructions

* update

* clarify that both dot and bracket notations are interchangeable

* Clarify how check works

* create spec and config before updating connector definition

* clarify what now_local() is

* rename to yaml structure

* Go through tutorial and update end of section code samples

* fix link

* update

* update code samples

* Update code samples

* Update to bracket notation

* remove superfluous comments

* Update docs/connector-development/config-based/tutorial/2-install-dependencies.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/3-connecting-to-the-API-source.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* Update docs/connector-development/config-based/tutorial/4-reading-data.md

Co-authored-by: Augustin <augustin.lafanechere@gmail.com>

* fix path

* update

* motivation blurp

* warning

* warning

* fix code block

* update code samples

* update code sample

* update code samples

* small updates

* update yaml structure

* custom class example

* language annotations

* update warning

* Update tutorial to use dpath extractor

* Update record selector docs

* unit test

* link to contributing

* tiny update

* $ in front of commands

* $ in front of commands

* More readings

* link to existing config-based connectors

* index

* update

* delete broken link

* supported features

* update

* Add some links

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/record-selector.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* Update docs/connector-development/config-based/overview.md

Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>

* mention the unit

* headers

* remove mentions of interpolating on stream slice, etc.

* update

* exclude config-based docs

Co-authored-by: Sherif A. Nada <snadalive@gmail.com>
Co-authored-by: Augustin <augustin.lafanechere@gmail.com>
Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
2022-08-12 15:50:54 -07:00

2.5 KiB

Authentication

The Authenticator defines how to configure outgoing HTTP requests to authenticate on the API source.

Authenticators

ApiKeyAuthenticator

The ApiKeyAuthenticator sets an HTTP header on outgoing requests. The following definition will set the header "Authorization" with a value "Bearer hello":

authenticator:
  type: "ApiKeyAuthenticator"
  header: "Authorization"
  token: "Bearer hello"

BearerAuthenticator

The BearerAuthenticator is a specialized ApiKeyAuthenticator that always sets the header "Authorization" with the value "Bearer {token}". The following definition will set the header "Authorization" with a value "Bearer hello"

authenticator:
  type: "BearerAuthenticator"
  token: "hello"

More information on bearer authentication can be found here

BasicHttpAuthenticator

The BasicHttpAuthenticator set the "Authorization" header with a (USER ID/password) pair, encoded using base64 as per RFC 7617. The following definition will set the header "Authorization" with a value "Basic {encoded credentials}"

authenticator:
  type: "BasicHttpAuthenticator"
  username: "hello"
  password: "world"

The password is optional. Authenticating with APIs using Basic HTTP and a single API key can be done as:

authenticator:
  type: "BasicHttpAuthenticator"
  username: "hello"

OAuth

OAuth authentication is supported through the OAuthAuthenticator, which requires the following parameters:

  • token_refresh_endpoint: The endpoint to refresh the access token
  • client_id: The client id
  • client_secret: The client secret
  • refresh_token: The token used to refresh the access token
  • scopes (Optional): The scopes to request. Default: Empty list
  • token_expiry_date (Optional): The access token expiration date formatted as RFC-3339 ("%Y-%m-%dT%H:%M:%S.%f%z")
  • access_token_name (Optional): The field to extract access token from in the response. Default: "access_token".
  • expires_in_name (Optional): The field to extract expires_in from in the response. Default: "expires_in"
  • refresh_request_body (Optional): The request body to send in the refresh request. Default: None
authenticator:
  type: "OAuthAuthenticator"
  token_refresh_endpoint: "https://api.searchmetrics.com/v4/token"
  client_id: "{{ config['api_key'] }}"
  client_secret: "{{ config['client_secret'] }}"
  refresh_token: ""