surya prakash
surya prakash

Reputation: 21

Unable to access Datalake with Service principal Access token from PostMan

I have an Azure service principal with API permissions.

enter image description here

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.enter image description here

    {
    "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"
    }
}

enter image description here

Any suggestion to resolve this problem will be helpful :)

Upvotes: 0

Views: 432

Answers (1)

Sridevi
Sridevi

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

enter image description here

When I use the above generated token to call the API, I too got the same error as below:

enter image description here

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

enter image description here

After using above generated token, I'm able to call the API successfully like below:

enter image description here

Upvotes: 2

Related Questions