Reputation: 21
I have an Azure service principal with API permissions.
I am making an API call with it to get an access token. I am able to get the token but I cannot access datalake after I got that token. I set ACL permissions for this service principal at root container/dir/file level but still I cannot get the access.
I am getting the following error.
{
"error": {
"code": "InvalidAuthenticationInfo",
"message": "Server failed to authenticate the request. Please refer to the information in the www-authenticate header.\nRequestId:a08469ad-c01f-00dc-60c4-95a7d2000000\nTime:2022-07-12T07:55:28.3327947Z"
}
}
Any suggestion to resolve this problem will be helpful :)
Upvotes: 0
Views: 432
Reputation: 22562
I tried to reproduce the same in my environment via Postman and got below results
I generated access token using v1.0 token endpoint
same as you like below:
https://login.microsoftonline.com/tenantID/oauth2/token
When I use the above generated token to call the API, I too got the same error as below:
To resolve the error, you need to use v2.0 token endpoint
like
below to generate the access token:
https://login.microsoftonline.com/tenantID/oauth2/v2.0/token
After using above generated token, I'm able to call the API successfully like below:
Upvotes: 2