401 Unauthorized Error

luf 31 Reputation points
2021-01-27T03:31:07.363+00:00

I am trying to learn the Azure Digital Twins , but I have encountered problems in the learning process. I refer to the documentation:
https://learn.microsoft.com/en-us/azure/digital-twins/how-to-use-postman

![60739-azure-access-token.png][1]
{
"accessToken": "eyJ0eXAiOiJKV1Q*****",
"expiresOn": "2021-01-27 12:06:07.343634",
"subscription": "e692195c-08d1-****",
"tenant": "046eef93-bfa5-****",
"tokenType": "Bearer"
}

Postman Response:
{
"statusCode": 401,
"message": "Unauthorized"
}

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
231 questions
{count} votes

Accepted answer
  1. QuantumCache 20,271 Reputation points
    2021-01-27T20:34:22.847+00:00

    Hello @luf , we have verified the document and the Postman REST API call, we were unable to repro your reported issue, related to Unauthorized

    Please do verify the user permissions once again, and generate the bearer token from CLI to use it with Postman call.

    1) Assign the user a role on the ADT--->Assign the role
    2) Use the same user credentials(step1) to log in and generate the bearer token. Commandline usage.
    3) Make use of the generated token in postman call.

    Please do let us know the query you have used in the body section?

    61040-image.png

    61092-image.png

    Please let us know if you need further help in this matter.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.