You are either using an invalid auth token or you didn't associate it with your request properly. Refer to the documentation in Azure on how to properly create an auth token to use with Azure. There is a full discussion on how to do this with Postman here.
I'm trying to access Azure resources through rest api i'm getting error ?
This is my post man response body
{
"error": {
"code": "InvalidAuthenticationToken",
"message": "The received access token is not valid: at least one of the claims 'puid' or 'altsecid' or 'oid' should be present. If you are accessing as application please make sure service principal is properly created in the tenant."
}
}
https://learn.microsoft.com/en-us/rest/api/resources/resources/list-by-resource-group
2 answers
Sort by: Most helpful
-
-
ajkuma 27,256 Reputation points Microsoft Employee
2021-06-11T15:17:01.407+00:00 @VikasSingh-0102, Just checking if the suggestions posted by cooldadtx was helpful.
Typically, missing OID usually means the servicePrincipal for your app does not exist in the tenant in which your trying to access.
Each tenant in which you want to access must consent to your application. This will ensure the servicePrincipal exists in their tenant and that servicePrincipal has access to the Azure API.Kindly let us know if you need further assistance with some more (resource/webapps) details.
Note: Please do not share any PII data on the public forum.