Published: 19 Mar 2020 › Updated: 19 Mar 2020![Bash script - challenge [part 3]. Authentication test (token) using the curl program.](https://i.ecency.com/p/qjrE4yyfw5pEPvDbJDzhdNXM7mjt1tbr2kM3X28F6SraZemVtRKhsHxP7eQkfHS4Yw5ZHjU4atZmmj6y3UMF9fJ4NRB2UoRHur6EbNjQTAbtT2ikP9ftFAcN?format=match&mode=fit&height=377)
Bash script - challenge [part 3]. Authentication test (token) using the curl program.
Medium level.
Requires:
- An account on auth0.
- The curl program to be installed.
- Basic knowledge of Linux commands.
We need API to test (e.g. https://auth0.com).
Let’s go to API on auth0. (APIs->Settings->Test). Create & AUTHORIZE TEST APPLICATION
Create & AUTHORIZE TEST APPLICATION
Get access_token
curl --request POST \
--url https://dev-o1btb-69.eu.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"tPOxbJ8QEMj8VVZEHPHt7uTM0uAHPd4v","client_secret":"xppOcAF8mqzRvZo9EBfPjIVZzdlfHPiVDyXwsOv1NL-Wx-4IKSMh3wwZllxtgZPF","audience":"https://dev-o1btb-69.eu.auth0.com/api/v2/","grant_type":"client_credentials"}'
And next try to authenticate in test using the curl program.
curl --request GET \
--url https://dev-o1btb-69.eu.auth0.com/api/v2/ \
--header 'authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik5VSXdOalV4UWtJMVJFUkJOREJHUlVZME5qUXhRak0yTWprMFF6Y3lNVGt5TmpWQ1JFUXhNUSJ9.eyJpc3MiOiJodHRwczovL2Rldi1vMWJ0Yi02OS5ldS5hdXRoMC5jb20vIiwic3ViIjoidFBPeGJKOFFFTWo4VlZaRUhQSHQ3dVRNMHVBSFBkNHZAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGV2LW8xYnRiLTY5LmV1LmF1dGgwLmNvbS9hcGkvdjIvIiwiaWF0IjoxNTgzNTA5NTE3LCJleHAiOjE1ODM1OTU5MTcsImF6cCI6InRQT3hiSjhRRU1qOFZWWkVIUEh0N3VUTTB1QUhQZDR2IiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.eRWje68f11VgEO3mdZ3O-ICIVWlJNAhWx3JOF5-qzNILG9ZGWJ7zMQjUHAKQA0GkxRhWNcwFXpVeNuDwDUcb0IMFmaLfXCpvufcH0Pp_OtGw06iivlZwIjEEmstDUw8CU1gXiIImOOfI8FydrGft33ktkRKr0AN9pxcGUP-LanoaVRC2Lxoa5aNHAiThYk-kAT78-emUBdGG4cE_vGp7psH7BoDgLB7BxKkUgfQV1zAw-rLmXAYq-0h8oqrLZgkEQRCkOpHXa07Ls1W2N754EQbD8z6QuyHcbeicUQmVah_oNkc45v7Qv2r3sqX0BxSIy58OC5ocDWXJ24qd0yZ7eQ’
The next topic will be Reporting test results written using bash script.
Table of contents:
[Start] - Writing API tests using the curl program
[part 2] - Authentication test (session) using the curl program.
Leave Bash script - challenge [part 3]. Authentication test (token) using the curl program. to:
Read more #bash posts
Best Posts From grzesiek
We have not curated any of grzesiekb's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From grzesiek
- Bash script - challenge [part 3]. Authentication test (token) using the curl program.
- Bash script challenge [part 2]. Authentication test (session) using the curl program.
- Bash script - challenge. Writing API tests using the curl program
- Adding description for datasource state [develop Scada-LTS]
- New option in HttpRetriver datasource [Scada-LTS]
- New Export/Import pointHierarchy. [ScadaLTS]
- [Scada-LTS] The possibility to add image sets without requiring a reboot
- [Scada-LTS] The possibility to add image sets without a restart
- New Project “shop-at-everything”.
- A successful attempt on adding switch language option in the angular app and integrating it with crowdin.com
- Add login component [EN/PL]
- Generating data (multistate) for simulations in Scada-LTS. [EN/PL]
- Correct the api rest authentication [EN/PL]
- How the data of virtual multisate points in the Scada-LTS program change
- We add a virtual point with the ** multistate ** type (increment) in Scada-LTS
- Generating data (binary) for simulations in Scada-LTS / Generowanie danych (binarnych) do symulacji w Scadzie-LTS [EN/PL]
- Preview how data from "virtual-data source" (type binary - Alternate, No Change, Random) changes every second
- Add "virtual point" in "virual data-source" - with Binary type in Scada-LTS
- Add a "virtual data-source" in Scada-LTS
- Add permission mask decoding