Update: I think i've realised i have this very backwards, i'll post back if i get it going the right way around
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://learn.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?