Onedrive Authorization Issue

Mageshwari SS 40 Reputation points
2025-01-03T05:45:14.4766667+00:00

Hi Support Team,

We encounter the problem "Need admin approval" when we try to authorize OneDrive using oauth 2.0. The below urls are used

Auth URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Access Token URL:https://login.microsoftonline.com/common/oauth2/v2.0/token

Scope: offline_access files.readwrite.all

Clientid and clientsecrets are created using microsoft azure portal of free trail account.

The screenshot of authorization issue

Image

Thanks and Regards,

Mageshwari

Microsoft 365 and Office | OneDrive | For business | Windows
Microsoft Security | Microsoft Graph
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,371 Reputation points
    2025-01-03T06:24:25.0633333+00:00

    Hi @Mageshwari SS

    Try logging into your MS Entra ID as a global admin, then find the calling app and grant admin consent for the above permissions.

    User's image

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


1 additional answer

Sort by: Most helpful
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2025-01-03T07:24:19.79+00:00

    A while back, Microsoft started enforcing the need for admin consent for any "risky" apps, such as ones from unverified publishers. If this is an application you plan to use across multiple tenants, it is best to provision it within a proper, paid tenant, with the Publisher verification process completed. If it's an app you plan to use in your own tenant, provision it therein as a single-tenant application instead.

    Alternatively, you can ask an admin for consent as suggested above, or disable the step-up consent requirement for risky apps as detailed for example here: https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/configure-risk-based-step-up-consent

    0 comments No comments

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.