@Harm Horstman Come on, you're smart enough to get this working! 😉 We have more or less what you describe, except we send notifications to Teams instead of Email through the Graph API.
Step 1: perform the steps as described in the Microsoft URL provided by Mark: https://learn.microsoft.com/en-us/graph/auth-v2-user
Step 2: perform the steps as described in the Blog from Dick as referred to by Mark:
- Also read the Comments from me below that Blog
- Also see my Comments here:
- Also see my below recommendations
Some suggestions from our side
Split up the process in 3 distinct Process Flows:
- Process Flow with Task: OAuth Login connector + Decision node to write the Authentication and Refresh token to your Application → a Process Flow that you would start with a Task to trigger the Login. Basically only needed once, or once the below Scheduled Refresh flow fails (could happen after too long downtime of your Application).
- Scheduled System Flow: OAuth Refresh connector flow to update the Access and Refresh token before it expires (we do this every 29 minutes). This ensures you always have a valid Access token available for the next Process Flow.
- Scheduled System Flow: Basically the 3rd part is a regular HTTP Connector flow, in which the above retrieved Access token is used.
Be aware that Indicium / Universal GUI do not work well with the OAuth Login connector in all environments, even though it is supposed to be supported since Universal GUI 2023.1.12. If you encounter issues with the first Process Flow, you could also perform that step with Insomnia or Postman and update the response manually in your application.
We use a dedicated ‘automation@<yourdomain> user to send the notifications with the appropriate rights in the Azure AD App.
Let me know if you have more specific follow up questions!