6

I am using Office365 Rest api's to write into users onedrive for business. When i try to get the OAuth token by passing the Client ID, Client Secrete, Resource(https://****-my.sharepoint.com),RedirectUri(https://*******) I am getting the following error."AADSTS90093: Does not have access to consent" in office365

Where as I am able to get the authcode , access token ,refresh token for other users, only for couple of user's I am facing the above mentioned issue

Error Screen

Kirthi35
  • 185
  • 3
  • 16
  • Can you describe the user types? Are they admins or regular users? Can you tell us which permissions are set for the application? – Michael Mainer Dec 03 '14 at 17:54
  • One admin admin user and remaining all normal user... The user for whom I am getting error is a normal user with OneDriveforBusiness enabled for this o365 account – Kirthi35 Dec 03 '14 at 18:08

1 Answers1

7

Is this a multi-tenant app? Are the users that get the error all from specific Office 365 organizations? That error can happen if the organization admin has disabled users' ability to give consent to 3rd-party apps. See http://blogs.msdn.com/b/exchangedev/archive/2014/06/05/managing-user-consent-for-applications-using-office-365-apis.aspx for details.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
  • Yes its a multi-tenant app. But i am able to get the oauth token for others user from same organization have no issue. Only one particular user has this issue – Kirthi35 Dec 04 '14 at 02:58
  • Could it be that the administrator disabled user ability to consent after some of the "good" users in that organization already had consented? Existing consent for a user is not revoked when the admin disables it, but any users that had not already consented would be unable to do so. You might ask the administrator of that org to run the Set-MsolCompanySettings cmdlet (see the blog for details) just to rule it out. – Jason Johnston Dec 04 '14 at 15:50
  • Already made a cross check with admin, apart from that i also successfully got OAuth token for couple of users. – Kirthi35 Dec 05 '14 at 06:14