Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing OneDrive doc of Personal Account or Only one user in Business account via API #1219

Closed
1 task done
ghodasarakartik opened this issue Feb 4, 2020 · 11 comments
Closed
1 task done
Labels
ask-to:graph Question for Microsoft Graph, which has its own StackOverflow location for support. Needs: Author Feedback Needs feedback from the issue author no-recent-activity

Comments

@ghodasarakartik
Copy link

ghodasarakartik commented Feb 4, 2020

Category

  • Question

Hi Team,

I am able to access OneDrive items of all the users in Office 365 business account using a free trial created from this link.

https://www.microsoft.com/en-in/microsoft-365/business/office-365-enterprise-e3-business-software?rtc=1&activetab=pivot%3aoverviewtab

However, in order to make it work I needed to give my application below permission, which eventually allows this app to access OneDrive items of all the users in this tenant because of these permissions.

image

Now, my requirement is to access OneDrive document of only one users from this tenant and block the application from accessing documents from other users, or access document of any personal account (@hotmail.com/@live.com).

Please let me know if there is any way or in case I am doing anything wrong with the application I registered.

Appreciate any help.

@ghost ghost added the Needs: Triage 🔍 Needs initial triage assessment label Feb 4, 2020
@ghost
Copy link

ghost commented Feb 4, 2020

Thank you for your contribution to OneDrive API Docs. We will be triaging your incoming issue as soon as possible.

@ghodasarakartik
Copy link
Author

Hi Team,

Any quick look at this would be very appreciated.

Thanks in advance.

@ghodasarakartik
Copy link
Author

Hi Team,

Please let me know if this possible.

@ghodasarakartik
Copy link
Author

Hi Team, It's been a whole week and I don't have any reply, can anyone please have a look into it?

@chackman
Copy link
Contributor

chackman commented Feb 10, 2020

Thanks for your patience.

The "All" constraint potentially grants access to all users. For example, User.Read.All potentially grants the app privileges to read the profiles of all of the users in a directory.
If there is no constraint, then the application only potentially gets access to specific users. For example, User.Read grants privileges to read the profile of the signed-in user only

It sounds like delegated permissions is the way to go - have you looked into it?

See also: permissions reference for Microsoft Graph

Depending on your scenarios, this question might also be better answered in the Azure Active Directory forum. I've tagged it so our bot will provide a link to that forum.

@chackman chackman added the ask-to:azure-active-directory Question for AAD, which has its own StackOverflow location for support. label Feb 10, 2020
@ghost ghost added the Needs: Author Feedback Needs feedback from the issue author label Feb 10, 2020
@ghost
Copy link

ghost commented Feb 10, 2020

Thanks for your feedback. Since this question is about Azure Active Directory, could you please ask it here: https://stackoverflow.com/questions/tagged/azure-active-directory
Thanks!

@chackman chackman removed the Needs: Triage 🔍 Needs initial triage assessment label Feb 10, 2020
@ghodasarakartik
Copy link
Author

ghodasarakartik commented Feb 11, 2020

Hi @chackman

Thanks a lot for answering, the problem is if I go with only the delegate permissions, it is giving below error while accessing OneDrive documents

{
  "error": {
    "code": "AccessDenied",
    "message": "Either scp or roles claim need to be present in the token.",
    "innerError": {
      "request-id": "c64dcb8a-c16e-43f7-8223-3cb5c11b994d",
      "date": "2020-02-11T03:36:19"
    }
  }
}

@ghost ghost added Needs: Attention 👋 Needs attention, after providing additional information and removed Needs: Author Feedback Needs feedback from the issue author labels Feb 11, 2020
@chackman
Copy link
Contributor

That likely means the user hasn't consented to the permissions your application requested, or you application hasn't requested any permissions. I would recommend making sure you have followed the process documented on the Microsoft Graph site for getting access on behalf of a user.

@chackman chackman added status:answered and removed Needs: Attention 👋 Needs attention, after providing additional information ask-to:azure-active-directory Question for AAD, which has its own StackOverflow location for support. labels Feb 19, 2020
@chackman
Copy link
Contributor

I'll tag this item so our bot will provide a link to the Microsoft Graph forum.

@chackman chackman added ask-to:graph Question for Microsoft Graph, which has its own StackOverflow location for support. and removed ask-to:graph Question for Microsoft Graph, which has its own StackOverflow location for support. status:answered labels Feb 19, 2020
@ghost ghost added the Needs: Author Feedback Needs feedback from the issue author label Feb 20, 2020
@ghost
Copy link

ghost commented Feb 20, 2020

Thanks for your feedback. Since this question is about Microsoft Graph, could you please ask it here: https://stackoverflow.com/questions/tagged/microsoft-graph
Thanks!

@ghost ghost added the no-recent-activity label Mar 24, 2020
@ghost
Copy link

ghost commented Mar 24, 2020

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 10 days. It will be closed if no further activity occurs within 10 days of this comment. Thank you for your contributions to OneDrive API Docs!

@ghost ghost closed this as completed Apr 3, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ask-to:graph Question for Microsoft Graph, which has its own StackOverflow location for support. Needs: Author Feedback Needs feedback from the issue author no-recent-activity
Projects
None yet
Development

No branches or pull requests

2 participants