4

I have created Azure AD B2C Application and tried to integrate with React JS using MSAL Library , When i tried to get access token I am getting following error.

AADB2C90205: This application does not have sufficient permissions against this web resource to perform the operation

Any Help would highly appreciated.

visit2shobhit
  • 183
  • 1
  • 4
  • 15
  • 1
    please provide the code of msal app configuration – Sruthi J Dec 30 '20 at 19:20
  • Have you granted the application the permission to access the web api and granted the admin consent for the permission? Can you share your code and API permissions screenshots? – Carl Zhao Jan 04 '21 at 08:02

2 Answers2

10

The link provided by @Jas Suri is correct, but I need to add some more:

You need to create two applications, one representing the client application and the other representing the api application, and then use the client application to call the api application.

Next, you need to expose the api of the back-end application and record the scope name, then go to the client application to add the scope to the API permissions (you need to find it in My APIs), and grant the admin consent to the permission.

enter image description here

Finally, when you get the access token, you must add the scope.

enter image description here

enter image description here

Carl Zhao
  • 8,543
  • 2
  • 11
  • 19
3

You didn’t grant admin consent. Follow this: https://learn.microsoft.com/en-us/azure/active-directory-b2c/add-web-api-application?tabs=app-reg-ga

Specifically the Grant Permissions section.

Jas Suri - MSFT
  • 10,605
  • 2
  • 10
  • 20