Error: 401 - FileOpenUserUnauthorized - Graph API - OneDrive personal account

Lucas Klassmann 25 Reputation points
2024-04-16T14:23:48.9266667+00:00

Hi,

We are integrated with OneDrive and Sharepoint to Read and Write Excel files using Graph API.

We are facing a problem, recently, in some users' accounts that use OneDrive with personal account type(not work and neither school).

Some operations return this error:

FileOpenUserUnauthorized: You do not have permission to open this file in the browser.

    Inner Error: unauthorizedUncategorized

    Required authentication information for the resource is either missing or invalid.

    

These endpoints do not work:

https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/createSession

https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets

And this endpoint works:

https://graph.microsoft.com/v1.0/me/drive/root/children

The most basic test is to retrieve the files, get the Item ID, and try to read the worksheets.

  • I am using the file owners accounts(They have permission)
  • I am using XLSX files
  • Personal accounts

I got the error using the API, but I tested directly through Graph API Explorer and the same error happened.

I tested with two accounts side-by-side, one works and the other does not.

Can someone help and give guidance, because the documentation and bugs found on the internet did not help.

I appreciate any help. Thank you.

User A:User A

User B:User B

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,620 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Lucas Klassmann 25 Reputation points
    2024-04-26T11:59:40.9266667+00:00

    Hi Libor,

    I still did not find a solution. How I also tested directly in Graph API and got the same problem, I discarded it as an issue in my application. I am waiting for someone to say something that help me to solve this issue.

    Thanks

    0 comments No comments