简体   繁体   中英

Fetch contact from MS Dynamics CRM Web API with PHP

I'm using jamesmcq's library ( https://github.com/jamesmcq/oidc-aad-php-library ) to connect and fetch contacts data from Microsoft Dynamics CRM Online with PHP. I have successfully logged in via OAuth and got a token, but when I'm trying to access CRM Web API with the access_token, I got the following Exception:

AADSTS65001: The user or administrator has not consented to use the application with ID 'XXXXXX-XXXXXX-XXXX-XXX-XXXXXXX'. Send an interactive authorization request for this user and resource.

I already found this answer: https://stackoverflow.com/a/34885153/1305261 , but I have only access to the new Azure Portal, not the Classic, so I have no idea where can I find the settings that the guy talked about. Besides, I found something similar under the Azure Active Directory menu, and I granted access for all permissions, but the Exception is still there.

Can anyone help me how can I fix this error?

UPDATED: Here's my setup for the app's privileges: 在此处输入图片说明

In the new Azure Portal you can access that screen following the next steps:

  1. Azure Active Directory
  2. App registrations
  3. Select your application
  4. Required permissions

在此处输入图片说明

From there, you can add a new permission:

在此处输入图片说明

UPDATE:

在此处输入图片说明

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