Pranathi
Pranathi

Reputation: 1

Unable to authenticate azure App service and get the data in spfx react solution

We are trying to call a web api hosted in azure app service from SPFX react webpart using aadhttpclientfactory.

We are receiving the below error.

Error: Error - Type : interaction_required - Description : AADSTS65001: The user or administrator has not consented to use the application with ID <> named 'SharePoint Online Client Extensibility Web Application Principal'. Send an interactive authorization request for this user and resource.

Please suggest the process to resolve the above issue.

Thanks in advance.

Upvotes: 0

Views: 1053

Answers (2)

MikeP
MikeP

Reputation: 137

For us, we needed to give access to the “SharePoint Online Client Extensibility Web Application Principal” App Registration on our web-hosted API. Follow these steps to do this:

  1. Go to the App Registration for your web-hosted API
  2. Expose an API > Add a client application
  3. Input the client Id for the “SharePoint Online Client Extensibility Web Application Principal” App Registration
  4. Select the checkboxes for any permissions

Upvotes: 1

Tony Ju
Tony Ju

Reputation: 15629

You need to consent to use the application. Go to azure portal->Azure Active Directory->App registrations->find your application->Api permissions->click Grant admin consent button(remember to login with the admin account)

enter image description here

If the permissions does't require admin consent, you can also use individual user consent which doesn't need admin permission.

Upvotes: 0

Related Questions