Kaustav Ghosh
09/24/2024, 9:27 AMuser
09/24/2024, 9:27 AMBasicHttpAuthenticator
in Airbyte is used to set the "Authorization" header with a (USER ID/password) pair, encoded using base64 as per [RFC 7617](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#basic_authentication_scheme). The following definition will set the header "Authorization" with a value Basic {encoded credentials}
. The BasicHttpAuthenticator
takes two inputs: username
and password
. The password
is optional. Here is the schema for `BasicHttpAuthenticator`: yaml BasicHttpAuthenticator: type: object additionalProperties: true required: - username properties: "$parameters": "$ref": "#/definitions/$parameters" username: type: string password: type: string
And here are examples of how to use it: yaml authenticator: type: "BasicHttpAuthenticator" username: "hello" password: "world"
yaml authenticator: type: "BasicHttpAuthenticator" username: "hello"
Internally, the BasicHttpAuthenticator
concatenates the username and password with a colon :
and encodes the resulting string using the base64 algorithm. This encoded string is then used to set the "Authorization" header in the HTTP request. For example, for username user
and password passwd
, the base64-encoding of user:passwd
is dXNlcjpwYXNzd2Q=
. The HTTP request would then include the header Authorization: Basic dXNlcjpwYXNzd2Q=
. For more information, you can refer to the [BasicHttpAuthenticator Reference](https://docs.airbyte.com/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/BasicHttpAuthenticator) and the [Basic HTTP Authentication method](https://docs.airbyte.com/connector-development/connector-builder-ui/authentication#basic-http) in the Airbyte documentation.