question

PatrickBrown-3037 avatar image
0 Votes"
PatrickBrown-3037 asked PatrickBrown-3037 commented

Best practices for using msal-node and microsoft graph APIs in a serverless environment?

I am running a NextJS serverless application.

I am using msal-node to acquire a token, which is then passed to the microsoft graph client ( @microsoft/microsoft-graph-client ) like this tutorial here: https://docs.microsoft.com/en-us/graph/tutorials/node?tutorial-step=3

However in that example the local token cache is used to find the account and acquireTokenSilent is used which is supposed to transparently handle token refresh

In a serverless application where it may be restarted at any time, what is the correct way to store, retrieve, and pass tokens to the graph client?

Thanks

microsoft-graph-mailazure-ad-msal
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

MohammedMehtabSiddiqueMINDTREELIMI-9821 avatar image
0 Votes"
MohammedMehtabSiddiqueMINDTREELIMI-9821 answered PatrickBrown-3037 commented

Hi @PatrickBrown-3037 , Thanks for reaching out you can use refresh token if your access tokens have expired.

186324-image.png


Please refer the this refresh-tokens



Hope this helps.


image.png (23.3 KiB)
· 1
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.

This doesn't answer my question

0 Votes 0 ·