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.
12,004 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
258 questions
{count} vote

2 answers

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

  2. Baris 0 Reputation points
    2024-05-27T09:51:29.9633333+00:00

    I opened a new question about this problem, ı have too the same problem. You can follow the link below.


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.