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.

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:

  1. 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.

  2. Copy the following string, which you must enter in the Authorization Header field when you create the connection:

    Basic <resulting_base64_encoded_string>

If the user name is "admin" and the password is "testpassword" for example, the command is:

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:

  1. 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)

  2. Copy the following string, which you must enter in the Authorization Header field when you create the connection:

    Basic <resulting_base64_encoded_string>

If the user name is "admin" and the password is "testpassword" for example, the commands are:

$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