The command that I've executed is:
curl --location --request POST 'URL_HERE' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'assertion=Bearer JWT_TOKEN_HERE' --data-urlencode 'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer'
On my VPS
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 152 100 152 0 0 1876 0 --:--:-- --:--:-- --:--:-- 1876
{
"status": 401,
"code": "invalidToken",
"message": "The Authorization token is not valid.",
"traceId": "CLIENT_ID_HERE",
"internal": "nil"
}
curl: (3) Host name ' --header' contains bad letter
curl: (3) Port number ended with ' '
curl: (3) Host name ' --data-urlencode' contains bad letter
curl: (3) Host name 'assertion=Bearer JWT_TOKEN_HERE
curl: (3) Host name ' --data-urlencode' contains bad letter
curl: (3) Port number ended with 'i'
On my Local Computer
{
"access_token": "Bearer ACCESS_TOKEN_HERE",
"expires_in": 3600,
"api_domain": "URL_HERE",
"token_type": "Bearer"
}
question from:
https://stackoverflow.com/questions/65861465/im-trying-to-get-access-token-from-an-api-and-im-getting-some-errors-on-my-vp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…