1
votes

Microsoft.graph Rest.Api

i trying to get information about me from graph.api with https://graph.microsoft.com/v1.0/me

it's give me an error 401 Unauthorized error below

401 - Unauthorized: Access is denied due to invalid credentials.

But it will work for another account this is not work only one specific account. And some request also work for same access_token for example https://graph.microsoft.com/beta/me/insights/trending worked just fine

i could not find what the differencies with this account and i also add all necessary permissions like openid,profile,offline_access.User.ReadWrite.All etc.

I Also check this other topics in here but i could not find same error like me

2

2 Answers

0
votes

If you face the issue of "Access is denied" and so and while using the Microsoft Graph API, you always need to check the permission first. This type of exception has nothing to do with the programming itself.

0
votes

i just figure it. When i try to connect v1.0/me with User.ReadWrite.All permissions it didn't work because i just added User.ReadWrite.All and i supposed it is the same like User.Read User.ReadWrite but clearly it isn't, when i add that permissions it works fine.