AADSTS65002
What Microsoft says
Consent between first party application '{applicationId}' and first party resource '{resourceId}' must be configured via preauthorization - applications owned and operated by Microsoft must get approval from the API owner before requesting tokens for that API. A developer in your tenant might be attempting to reuse an App ID owned by Microsoft. This error prevents them from impersonating a Microsoft application to call other APIs. They must move to another app ID they register.
How to fix it
Microsoft doesn't publish a specific fix for this code beyond the description above. This site groups it under consent and permissions, based on that description, so start with the steps below.
How to investigate
- Open the Enterprise App and check Users and groups (assignment) and Permissions (consent).
- Check whether user consent is allowed for this kind of permission, or whether an admin needs to grant it.
- Look at the app's requested permissions in the sign-in request or app registration.
- Search the sign-in logs for the request ID or correlation ID from the troubleshooting details on the error page.
Tools that help
The description is quoted from Microsoft's error code reference. The grouping and investigation steps are this site's guidance.