Get Bearer access_token for backend using EasyAuth in SPA

Oleksandr Balashov 0 Reputation points Microsoft Employee
2025-04-14T09:43:44.9933333+00:00

Hello,
I have Web App (SPA on React) that is using MSAL library to get access_token and make request to backend.

I need to apply EasyAuth for SPA to avoid transfer JS code to unauthenticated users.
From /.auth/me I am able to get access_token, but it conatins:

"aud": "00000003-0000-0000-c000-000000000000",
"scp": "Directory.Read.All profile User.Read User.Read.All openid email",

With this access_token I can't make a reqest to backend. In App registration I have assigned 'API permission' for backend.
There is no changes in 'scp' in access_token that I receive, even though I specify api://<app-id> in <Web App>->'Authentication'->'Edit identity provider'->'Allowed token audiences'.

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
832 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.