Using Teams, SharePoint, Outlook Connector in Unattended Process Times Out

Hello Community - MS Graph API permissions are setup in Azure Portal and UiPath Integrated Services Connectors are created and connected in Orchestrator.

However, the connection disconnects after a time (60 min) and the only way I’ve found to reconnect is to manually fix the connection in Orchestrator.

Has anyone been successful in using the MS Graph connectors in an unattended process?

@duke.ames

May I know what authentication are you using ?

We use clien id and secret in integration services and it works without any disconnects..so wahted to check the same

Cheers

@duke.ames

I got some answer from LLM, follow below steps and see whether it can fix your bug or not

  • Integrated Service connectors like MS Graph use OAuth 2.0, typically with a delegated token.
  • These tokens expire in 60 minutes unless refresh tokens or client credentials flow are used.
  • For unattended bots, you should not use delegated permissions, but application-level (client credentials).

:white_check_mark: Recommended Solution: Use Application Permissions (Client Credentials Flow)

  1. Azure Setup:
  • Go to Azure Portal > App registrations > Your App.
  • Under API Permissions, ensure you’ve added Application permissions (not Delegated).
    • Example: Mail.Read, User.Read.All, etc. (under Application).
  • Click “Grant admin consent” after adding permissions.
  1. Create a Client Secret:
  • Go to Certificates & secrets in your app.
  • Create a new Client Secret and copy it (you won’t see it again).
  1. Use Client Credentials Flow in UiPath:
  • In UiPath Orchestrator, go to Integration Service > Connectors > MS Graph API.
  • When creating the connection:
    • Choose “Use client credentials”.
    • Provide:
      • Tenant ID
      • Client ID
      • Client Secret
    • This will use application context, allowing unattended bots to work without token expiration issues.

:white_check_mark: Additional Tips:

  • This setup allows long-lived tokens (or token refresh) without human intervention.
  • Make sure your Azure AD app has admin consent granted for those application permissions.
  • Avoid using delegated permissions if your bot is not using a user session (i.e., unattended).

:white_check_mark: Alternative: Use HTTP Requests with OAuth 2.0

If Integrated Services don’t meet your need:

  • Use HTTP activities in UiPath.
  • Manually implement OAuth 2.0 client credentials flow to get an access token.
  • Use that token in header for your MS Graph API calls.

:white_check_mark: Final Thought:

You can use MS Graph connectors in unattended processes reliably, but only if you use application permissions (client credentials) rather than user-delegated tokens.

Hi Anil / Yed - Thanks for the replies and info. So, we’ve got Azure setup with Delegated permissions as our security team won’t allow us to use Application permissions. Will try using the HTTP Request Activity.

Yed - How did you find the summary (LLM)? Very good details and complete information on how to setup Azure API Permissions and then the UiPath Connector.