question

md-1799 avatar image
0 Votes"
md-1799 asked md-1799 answered

connecting front end react spa with node.js backend daemon service

Hi, I have a react SPA using @azure/msal-react and @azure/msal-browser - similar to this tutorial, so I can sign in, call the MS graph api, sign out etc as documented there. Sp far, so good.

However, for my app I want the user signing in to the react SPA to be authorising a backend service / daemon (for my app) to perform actions on their behalf against the graph api, even when they don't have the react SPA open and signed in. The backend is written in node.js sitting behind an api gateway. So I'm thinking there might be some way to pass the client side information / tokens across to @azure/msal-node so that the backend daemon can keep using the graph api on behalf of the user - but I can't find any information around this.

Is this possible? Can anyone point me at some material in the right direction?

Thanks! Mark

Update: it seems to me what I'm trying to do is similar in intent to this section of this page: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#advanced-accessing-the-users-cached-tokens-in-background-apps-and-services - sharing the token cache?



azure-active-directoryazure-ad-msalazure-ad-app-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

md-1799 avatar image
0 Votes"
md-1799 answered

Update: I think i've realised i have this very backwards, i'll post back if i get it going the right way around

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.