Hello.
I have a problem or question about token.
-
I created a third party application and save client_id/client_secret
-
I request a token via below curl command and received a token. (I specified the scope in curl command)
curl -X POST -H “Content-Type: application/x-www-form-urlencoded” “https://<>/multipass/api/oauth2/token” -d “scope=api:usage:datasets-write” -d “grant_type=client_credentials” -d “client_id=<<client_id>>” -d “client_secret=<<client_secret>>” -
response.
{“access_token”:“<<token_generated>>”,“scope”:“”,“expires_in”:3600,“token_type”:“bearer”} -
I also create another request (upload file) with above token_generated
curl -X POST -H “Content-type: application/octet-stream” -H “Authorization: Bearer <<token_generated>>” “https://<>/api/v2/datasets/<>/files/a.pdf/upload?transactionType=APPEND” --data-binary @D:/awork/test/a.pdf -
But, I received an error that I don’t have permission.
{“errorCode”:“PERMISSION_DENIED”,“errorName”:“ApiUsageDenied”,“errorInstanceId”:“38de12c0-8dea-48d1-92b9-c74aa3312e78”,“parameters”:{“missingScope”:“api:usage:datasets-write”}}
I specified an scope api:usage:datasets-write when I request a token, but errors are happening with response token.
What’s wrong in my process?
I need your comments.
Thank you