Azure AD Protected Web API calls failed with Consent error

225 views Asked by At

I have an application(WebApp) which calls external API(WebApi1) and WebApi1 calls Another external Api WebApi2.

I have given application permission to WebApi1 from WebApp Similarly application permission to WebApi2 from WebApi1

I got consent page for WebApi1 and accepted it, it works fine for WebApi1. But when I tried to call WebApi2 with on behalf of user from WebApi1, it throws consent page error.

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

1

There are 1 answers

0
Fei Xue On

If you register the app from Azure portal, there is no need to config the knownClientApplications since it already give the consent when we register the app.

And if you register from other portal, after you config the KnownClientApplications you need to grant the permission again to use the parameter prompt=consent. In this time, the web app will also require you to give the consent to the web api2. After you grant the consent, the issue should be fixed.