question

71180230 avatar image
0 Votes"
71180230 asked ajkuma-MSFT answered

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://docs.microsoft.com/en-us/rest/api/resources/resources/list-by-resource-group

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered

@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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
1 Vote"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.