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.
Join the community in our migration to Hive, a community built blockchain for the community. All Steem account holders will receive equivalent stake on the new Hive blockchain.
Please see this post on SteemPeak for more information.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit