Search code examples
c#azure-active-directorymicrosoft-partner-center

Microsoft Partner Center Price Sheet API: AADSTS65001: The user or administrator has not consented to use the application with ID ''


I get this error :

AADSTS65001: The user or administrator has not consented to use the application with ID '' named ''. Send an interactive authorization request for this user and resource. Trace ID: 9cc0a97c-b602-4cb1-8325-545833b47b00 Correlation ID: 00853d8f-9f51-4708-b44b-3f0392503b1f Timestamp: 2024-02-14 17:41:18Z

anytime i generate a refresh_token and try to use this refresh token to get an access token that i can then pass to the price sheet api to get price sheet for a region.


Solution

  • Note that: To call Microsoft Partner API, you must grant Microsoft Partner API permissions to the Microsoft Entra application.

    Grant Admin consent to the below API permission:

    enter image description here

    I used below endpoint to authorize users:

    https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize?
    &client_id=ClientID
    &response_type=token
    &redirect_uri=https://jwt.ms
    &scope=https://api.partner.microsoft-int.com/user_impersonation
    &state=12345
    

    enter image description here

    Access token generated successfully:

    enter image description here

    If still the issue persists, Go to Microsoft Entra ID -> Enterprise applications -> User settings -> Consent and permissions

    enter image description here