web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Token Refresh Error fo...
Power Automate
Unanswered

Token Refresh Error for some users, sometimes

(0) ShareShare
ReportReport
Posted on by 1,247 Super User 2024 Season 1
I have a flow that uses a power apps trigger. Users click a button in the canvas app, and the flow runs. The first non-variable action in the flow is creating a sharepoint list item. This action fails for some users. If they refresh the power app and try again, it works. Or, if I access the failed run and click resubmit, it works. I've made sure that they have contribute access to the list, and there are no premium connectors in this flow. 
 
The error message is:
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. ... 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 ... and was inactive for 90.00:00:00. 
 
Any idea what token it's talking about? The user's? If so, they've been using the power app, and to get to the screen with the button to call the flow, they had to go through other screens that read data from the same SharePoint site. It says sharepoint online is in the block list, which suggests a problem with a policy, but again, it works if they refresh and try again. 
 
edit: a few more details I've learned: the user's refresh token has expired, either because they didnt't log in for 90 days or because their password changed. the fact that the flow fails with an invalid refresh token makes perfect sense, as flow can't kick off an interactive login dialog. The question is how is it possible for the user to access the power app, click through several screens to get to the screen with the button that starts the flow, all with an expired refresh token? If the user refreshes their browser, they apparently get a new refresh token, and the flow completes successfully. 
 
Any ideas, other than popping up a message telling users to refresh their browser?
Categories:
I have the same question (0)
  • SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    Hi  , 
     
    The flow might use the connection tied to the individual user who triggered it. If their token has expired, the flow fails. 
     
    Reconfigure the SharePoint Connection in the Flow: Open the flow in Power Automate. Go to Connections and ensure the SharePoint connection is valid. If the connection shows as expired or has errors: Reauthenticate it with valid credentials. Reassign the connection to a user or service account with uninterrupted access.
     
    Use a Service Account for the SharePoint Connection (If Appropriate) - Instead of using individual user connections, set up a service account with "Contribute" permissions on the SharePoint list.
  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at
    SairRT14, in the list of connections, everything shows as connected, and there are no errors or warnings. The flow does already use a service account to run, and that account has access to the sharepoint list (again, the flow works fine for some users, so the basics seem to be ok). 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard