Microsoft Authentication Library (msal) with Power Automate

vshets 96 Reputation points
2021-02-27T01:53:13.773+00:00

I would like to generate new tokens (from Microsoft graph api) and reuse tokens (until they expire) using power automate. However I do not see any built in connectors to use msal. One solution is as below:

pZc2v.png

However as you can see, each time the table is modified, it generates a new token. I would like to avoid this step and instead use token cache until I am required to generate new token. I see that 3rd party libraries (python, c# etc) provide this capability. Given such libraries exist, how can I leverage them to securely generate and reuse tokens - do I have to create a custom connector and invoke a python script (utilizing msal lib) from Azure functions? If so, this looks a bit convoluted since MSAL is integral and part and parcel of MS, so I was hoping for more direct integration with a cleaner solution.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
Community Center | Not monitored
{count} votes

2 answers

Sort by: Most helpful
  1. Ehren (MSFT) 1,781 Reputation points Microsoft Employee
    2021-03-17T21:29:11.327+00:00

    I'm not sure whether what you're trying to do is possible, but if it is you would likely need to write a custom connector. @Miguel Escobar may be able to provide more guidance.


  2. Miguel Escobar 326 Reputation points Volunteer Moderator
    2021-03-17T21:40:05.177+00:00

    Hey!
    I believe what you'll need is a Power Automate custom connector:
    https://learn.microsoft.com/en-us/connectors/custom-connectors/define-blank

    There's even this tutorial that can help you with creating that custom connector for Power Automate:
    https://learn.microsoft.com/en-us/graph/tutorials/power-automate

    In terms of MSAL vs ADAL, I believe you can create a custom connector that supports either.

    Hope this helps!

    0 comments No comments

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.