OneDrive API connection is not working for my outlook365 account

Luis 20 Reputation points

In my proyect, my users can sync their onedrive so they canuse their files within my application. I wrote the code and when i try and connect my personal hotmail account it works fine. I get access to the files in my drive no problem. BUT the problem is that whenever I try to connect my mail account i get the following error:


I double checked my azure portal and the scopes are on the app. AND this only happens when I try to use my account. My personal one works like a charm. And the code is the same for both cases, it is the same app, same request, same everything.

I think it may be a problem with the onmicrosoft account, but i found no documentation on the matter.

Any ideas?

A family of Microsoft email and calendar products.
2,660 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,013 questions
A Microsoft file hosting and synchronization service.
732 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,563 questions
{count} votes

Accepted answer
  1. CarlZhao-MSFT 35,266 Reputation points

    Hi @Luis

    I decoded your error message and found that you are using "," sign to separate permissions, which may be the cause of the problem. You should separate permissions with spaces, like this:

    scope=Files.Read Files.Read.All Files.ReadWrite offline_access Files.ReadWrite.All Files.ReadWrite.AppFolder Files.ReadWrite.Selected User.Read

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful