Issue with OBO authentication flow

Clarissa De Simoni 0 Reputation points
2026-05-27T15:30:00.27+00:00

The project I'm working on is a website that allows cutomers of my company to interact with foundry agents and perform a few msgraph actions like reading/writing to files and send emails. The agents should be able to use the sharepoint tool to look for the answer to give to the user. This requires delegated permissions and the OBO auth flow.

I started with just one app registration and two web apps, but it wasn't working so after some research I discovered that I need two app registrations: the one for the backend lists all the necessary msgraph permissions and exposes a scope, while the one for the frontend lists that scope as permission. In the backend mainfest I inserted the client id of the frontend app registration in the known applications list. I asked my admin to grant admin consent for all permission and he's done that.

This is the current flow: after the user is authenticated, whenever a request to msgraph is needed, the frontend (react typescript) gets the access token and sends it to the backend in the Authorization header. The backend tries to use it to access msgraph but I get the following error:

Authentication failed: AADSTS65001: The user or administrator has not consented to use the application with ID '<backend_client_id>' named '<backend_app_name>'. Send an interactive authorization request for this user and resource. Trace ID: a0bc626f-e237-4d15-9ff1-d6b745b22200 Correlation ID: f8745d89-ef88-4c37-b457-1b093a726930 Timestamp: 2026-05-27 15:08:51Z

Content: {"error":"invalid_grant","error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID '<backend_client_id>' named 'Fuji AI Backend'. Send an interactive authorization request for this user and resource. Trace ID: a0bc626f-e237-4d15-9ff1-d6b745b22200 Correlation ID: f8745d89-ef88-4c37-b457-1b093a726930 Timestamp: 2026-05-27 15:08:51Z","error_codes":[65001],"timestamp":"2026-05-27 15:08:51Z","trace_id":"a0bc626f-e237-4d15-9ff1-d6b745b22200","correlation_id":"f8745d89-ef88-4c37-b457-1b093a726930","suberror":"consent_required","claims":"{\"access_token\":{\"capolids\":{\"essential\":true,\"values\":[\"667629b5-0ce2-4898-a7a5-292aa4a73940\"]}}}"}

I understand that I have to ask the user for consent but I don't know how to. if I just put the backend scope, I get that error, if I add the msgraph scopes, I get the error that says I'm not allowed to ask for permission for two or more resources at the same time.

It's my first time using Azure and its authentication flow, so if you can explain in detail where I went wrong and how to fix it, it'd be much appreciated.

Have a good one and kind regards,

Clarissa De Simoni

Microsoft Security | Microsoft Entra | Microsoft Entra ID

Your answer

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