简体   繁体   中英

AADSTS65001: The user or administrator has not consented to use the application with ID " XYZXYZXYZ"

We build an application using Microsoft graph api's. We register app using our personal account for authentication in azure portal. All things are working perfectly when user authenticate using his personal login credential. But when user use their organizational account for authentication eg "kaz@deltaforcegroup.co.uk" then it authenticate but it gives an error

在此处输入图像描述

how can we resolve this issue? which permissions we have to add for avoid this dialogue box?

To resolve this issue for Need admin approval Make sure to allow user consent for application

Sign into the Azure portal as a Global Administrator ->Enterprise applications -> Consent and permissions under security -> user consent setting -> allow as below and save

在此处输入图像描述

> [AADSTS65001: The user or administrator has not consented to use the application with ID

This issue frequently happens when you failed to grant admin permission to the scope, please check few workarounds:

In your Azure Portal -> Azure AD-> App Registrations -> Your App -> Expose an API ->Try to add application ID URI -> Add scope and client application as below 在此处输入图像描述

After adding expose an Api. Try to add API permission to access your app In your azure portal -> Api permission under manage -> add permission ->select MY APIS -> select your app -> add permission ->make sure to grant admin consent like below

在此处输入图像描述在此处输入图像描述

Please check this Reference:resolving-need-admin-approval-error and similar SO thread by carl zhao

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM