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.
Basic authentication uses a colon (:) as a special character to separate the username and password information (for example, john.doe:1a2b3c4d5e). Therefore, avoid including a colon in your username or password to prevent errors from occurring.
Some services may have additional requirements for the Authorization header, so see the service's documentation for more information (for example, a password for the ServiceNow service cannot exceed 100 characters).
Instead of a password, Jira and Jira Service Desk connections require an API token that you must create in your Atlassian account before you begin the following procedure. For instructions on how to create and use the API token, see Create an API token in the Atlassian documentation.
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