Generate an Authorization Header
If the third-party application to which you want to connect requires a Basic HTTP Authorization request header, you can use these instructions to generate the header. The command requires the valid user name and password (or API token) in the application to which you want to connect, and it encodes the credentials with base64.
In the Authorization Header field, you enter the word "Basic" (which is the Authorization header type), a space, and then the base64-encoded credentials.
Connections to your third-party application that you create with the universal Webhook connection might also require an API token or integration key instead of a password. For requirements and instructions, see the vendor documentation.
To generate the header on Linux and Mac OS X:
- In the command line, type the following command, including the single quotation marks:
echo -n '<user_name>:<password_or_api_token>' | base64
where you must replace <user_name> with a valid username and <password_or_api_token> with either a password or an API token for the third-party application.
- Copy the following string, which you must enter in the Authorization Header field when you create the connection:
Basic <resulting_base64_encoded_string>
echo -n 'admin:testpassword' | base64
and the command produces this output:
YWRtaW46dGVzdHBhc3N3b3Jk
So, in the Authorization Header field, you would paste:
Basic YWRtaW46dGVzdHBhc3N3b3Jk
To generate the header in Windows PowerShell:
- In the command line, type the following commands, including the quotation marks:
$auth = [System.Text.Encoding]::UTF8.GetBytes("<user_name>:<password_or_api_token>")
where you must replace <user_name> with a valid username and <password_or_api_token> with either a password or an API token for the third-party application.
[System.Convert]::ToBase64String($auth)
- Copy the following string, which you must enter in the Authorization Header field when you create the connection:
Basic <resulting_base64_encoded_string>
$auth = [System.Text.Encoding]::UTF8.GetBytes("admin:testpassword")
[System.Convert]::ToBase64String($auth)
and the command produces this output:
YWRtaW46dGVzdHBhc3N3b3Jk
So, in the Authorization Header field, you would paste:
Basic YWRtaW46dGVzdHBhc3N3b3Jk