Basic Auth headers are frequently used as part of communication between applications, e.g. as part of API calls.
Common use cases in the Ataccama context include (and not limited to):
- Graphql call to ONE application
- API call to an online service set up on a DQC / runtime / orchestration server
Option 1: Do it in a ONE Desktop plan
-
Create a new plan
-
Create a step that evaluates expressions, e.g. Alter Format
-
Go into the expression window and put this expression in. The username and password are separated with a colon:
coding.toBase64('username:password')
- Click Evaluate
- Copy the result string
- Your header is going to be
Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Option 2: Use an online base64 encode website
If you are building something to integrate with Ataccama but you don’t actually have Ataccama ONE Desktop installed….
-
Go to a website that offers this conversion (e.g. link. Warning: this site is not affiliated with Ataccama)
-
Put in your username and password in this format:
username:password
, separated by a colon -
Convert. (Result of the conversion =
dXNlcm5hbWU6cGFzc3dvcmQ=
) -
Take that string and make your header like so:
Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Option 3: Linux/Unix/MacOS shell
-
In the shell, use command:
echo -n user:password | base64
Option 4: Windows 7 or later, Power Shell
$Text = ‘user:password’
$Bytes = BSystem.Text.Encoding]::UTF8.GetBytes($Text)
$EncodedText = dConvert]::ToBase64String($Bytes)
$EncodedText
Once done, you can make the Http header for our Graphql calls in our Graphql playground, in this format:
{”Authorization”: “Basic dXNlcm5hbWU6cGFzc3dvcmQ=”}
Or in ONE Desktop Json Call step: