79505240

Date: 2025-03-13 02:04:00
Score: 1.5
Natty:
Report link

Here are some suggestions you can check. The exposed API

api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws is different from what I can see on the error message api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal.

Make sure you are exposing a correct address.

If you use encodeURIComponent() on the entire scope, the slashes (/) will be encoded, which may cause Azure to misinterpret the scope. you can try it like :

"scope=" + encodeURIComponent("api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws")

or just hard code it for testing, like:

"scope=api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws"

In your error message, stated tenant mismach.

Also, make sure that the API permission is consented for users. If not, try granting Admin Consent in Azure Portal under API Permissions.

Plus, When requesting a token, ensure that you are requesting Delegated Permissions under API Permissions and that they match what is configured under Expose an API.

Verify that the scope is set under Expose an API. Make sure the Client ID matches the registered application. Check if the Application ID URI (api://{client-id}) is correctly set in Expose an API.

You can also log your scope before redirecting and make sure the scope is set correctly: console.log("Requested Scope: ", scopeName);.

If still you couldn't spot the issue, please provide more information.

Good luck.

Reasons:
  • RegEx Blacklisted phrase (2.5): please provide
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: AminM