0
votes

I created an Azure AD B2C tenant, added applications to it. After running the application, it allows me to enter username and password, but when I click login it throws an error,

inner exception = null: invalid_resource;AADSTS500011: The resource principal named api://8e82b4f2-4962-4b66-a6f5-76667400cfed was not found in the tenant named. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.

Am using this library MSAL Mobile Flutter Plugin. I have followed all the steps described by documentation on the plugin, and on azure portal, but end up with that error. And I am logging in with users from the same tenant

What am i doing wrong?

1
If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you.Carl Zhao
Thank you @CarlZhao will check itblackbird

1 Answers

1
votes

I can easily reproduce your problem. enter image description here

For AAD b2c tenant, it is somewhat different from AAD tenant. I noticed that the sample you refer to is aad. If you use aad b2c tenants, its scope should be:

https://zhaozhub2c.onmicrosoft.com/0ffde1a6-04d2-440e-87a5-d9fd69dbxxxx/mytest.

enter image description here

Please note that you cannot use client credential flow for Azure b2c because Azure b2c requires user login. I used ROPC flow to test and it works well.

enter image description here