Skip to main content

Notifications

Community site session details

Community site session details

Session Id : t4JnzFNAnK7J0UXGjmsCxd
Power Automate - Building Flows
Suggested answer

Error from token exchange

Like (0) ShareShare
ReportReport
Posted on 26 Feb 2025 10:00:08 by 4
Hello,
 
I have created an instant flow for a power app which is triggered from a button. When i test the flow it is running with no issues. When though a user tries it, i get the following error:

Error from token exchange: Runtime call was blocked because connection has error status: Enabled| Error, and sharepointonline is in the block list. Connection errors: [ParameterName: token, Error: Code: Unauthorized, Message: 'Failed to refresh access token for service: sharepointonlinecertificatev2. Correlation Id=bb07ba02-fc95-466f-964e-dbff3338cd09, UTC TimeStamp=2/26/2025 8:40:08 AM, Error: Failed to acquire token from AAD: {"error":"invalid_grant","error_description":"AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2024-11-13T13:04:43.0420964Z and was inactive for 90.00:00:00. Trace ID: 72a1f160-a8fc-4fc5-85e1-1f1b52942400 Correlation ID: 3a1ada92-5d9b-4f00-ade6-97c8683c8bea Timestamp: 2025-02-26 08:40:08Z","error_codes":[700082],"timestamp":"2025-02-26 08:40:08Z","trace_id":"72a1f160-a8fc-4fc5-85e1-1f1b52942400","correlation_id":"3a1ada92-5d9b-4f00-ade6-97c8683c8bea","error_uri":"https://login.windows.net/error?code=700082"}']
 
On flow properties i add the users on the "Manage run only permissions".
 
I have also created on the environment a custom basic user security role where i gave access to the following.
 
 
It still fails though and i dont know what i miss.
 
Can you please advice?
 
Thanks in advance for your support,
 
Manos
Categories:
  • Suggested answer
    FatihDagdelen Profile Picture
    53 on 05 Mar 2025 at 10:32:53
    Error from token exchange
    Hi,

    It could be a lot of reasons first of all :)

    some of them are here:

    Root Cause:

    1. The error message AADSTS700082 means that the Azure Active Directory (AAD) refresh token for Office 365 has expired due to inactivity.
    2. The connection to Office 365 (aadcertificate) is in an error state and needs to be re-authenticated.
    3. Power Automate is blocking the runtime execution because the Office 365 token cannot be refreshed.
    4. This happens when:
      • The connection was created but not used for 90 days.
      • The user who created the connection left the organization or their account permissions changed.
      • The connection was not refreshed before expiration.

    Solution Steps:

    Check & Re-authenticate Office 365 Connection

    1. Go to Power Automate → "Data" → "Connections".
    2. Find the Office 365 connection (it might be named Office 365 Outlook, Office 365 Users, or similar).
    3. If it says "Error" or "Needs Attention", click on it and select "Fix Connection".
    4. Re-authenticate using a valid Office 365 account.

    Remove & Re-add the Office 365 Connection

    • If fixing the connection doesn’t work, try removing and re-adding the connection:
      1. Delete the broken Office 365 connection from Power Automate.
      2. Click "Add a new connection" and re-add Office 365.
      3. Authenticate again and test the flow.

    Assign a Service Account for the Flow

    • If the issue persists, instead of using a user’s connection, use a dedicated service account to avoid token expiration.
    • Steps:
      1. Create a shared service account in Microsoft 365.
      2. Assign this account the required permissions for Power Automate.
      3. Re-add connections using this service account.

    Verify Power Automate Run-Only Permissions

    • Ensure that the correct users have run-only permissions to execute the flow.
    • If using service accounts, check that the account has proper Office 365 & SharePoint permissions.
       
    I hope it helps you! :)

    Fatih
  • CU16121358-0 Profile Picture
    4 on 05 Mar 2025 at 10:01:24
    Error from token exchange
    I tried it today and this one popped:
    
    {"statusCode":401,"headers":{"x-ms-failure-cause":"apihub-token-exchange","x-ms-apihub-obo":"false","x-ms-apihub-cached-response":
    "false","Date":"Wed, 05 Mar 2025 07:54:30 GMT","Content-Length":"1141","Content-Type":"application/json"},"body":{"status":401,
    "source":"https://europe-002.token.azure-apim.net:443/tokens/europe-002/office365/c4c20b11abb1448c84a435e12c8981d5/exchange",
    "message":"Error from token exchange: Runtime call was blocked because connection has error status: Enabled| Error, and office365 
    is in the block list. Connection errors: [ParameterName: token, Error: Code: Unauthorized, Message: 'Failed to refresh access token 
    for service: aadcertificate. Correlation Id=ec053e19-3ccf-496f-a336-7fe26886cb3d, UTC TimeStamp=3/5/2025 7:54:31 AM, Error: Failed 
    to acquire token from AAD: {\"error\":\"invalid_grant\",\"error_description\":\"AADSTS700082: The refresh token has expired due to 
    inactivity. The token was issued on 2024-08-06T15:38:30.8322459Z and was inactive for 90.00:00:00. 
    Trace ID: ab1bd53e-e14d-4c3a-9212-119947d30600 Correlation ID: 3ec9ca8c-122a-4214-8e5d-5a171559b5b6 
    Timestamp: 2025-03-05 07:54:31Z\",\"error_codes\":[700082],\"timestamp\":\"2025-03-05 07:54:31Z\",\"trace_id\":\"ab1bd53e-e14d-4c3a-9212-119947d30600\",
    \"correlation_id\":\"3ec9ca8c-122a-4214-8e5d-5a171559b5b6\",\"error_uri\":\"https://login.windows.net/error?code=700082\"}']"}}
  • CU16121358-0 Profile Picture
    4 on 04 Mar 2025 at 12:14:56
    Error from token exchange
    Anyone can please help me on this issue?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 51

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 39 Super User 2025 Season 1

#3
Chriddle Profile Picture

Chriddle 21 Super User 2025 Season 1

Overall leaderboard
Loading started