Auth0 connectivity testing
1. How to use Auth0 token in rest call?
What is Auth0?
Auth0 is a commercial platform that performs authentication & authorisation for your application. It supports Single Sign On (SSO), OAuth 2.0 and SAML protocols. We use it for token based authentication for Machine to Machine (M2M) API flow.

Auth0 overview, get started
Reasons to use Auth0? Xano, Agilie
Auth0 features & benefits? Mind Bowser
Auth0 Machine To Machine API flow

How to use Auth0 token in rest call?
Get Auth0 token
#!/bin/bash
read -r -d '' DATA << EOF
{
"client_id":"xxxGetClientIdxxx",
"client_secret":"xxxGetClientSecretxxx",
"audience":"https://api.dev.xxx.cloud/customer/onboarding/v1/application",
"grant_type":"client_credentials"
}
EOF
curl --request POST
--url https://xxx-customer-dev.au.auth0.com/oauth/token
--header 'content-type: application/json'
--data "$DATA"
Use auth0 token in post call
// Internal url, eg https://moa.digital.dev.xxx.cloud/onboarding/v1/application
// external url, eg https://api.dev.xxx.cloud/customer/onboarding/v1/application
curl -v --request POST --url https://moa.digital.dev.xxx.cloud/customer/onboarding/v1/application
--header 'Authorization: Bearer xxxGetAuth0Tokenxxxx'
--header 'Content-Type: application/json'
--data '{
"opportunityId": "0064Y000002DPuzFAA",
"primaryContactName": "Ev M",
"primaryContactEmail": "[email protected]",
"businessName":"SF DEV Test",
"primaryContactPhone":"+61404000022",
"abn": "47099389510"
}'