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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / bad key authorization ...
Power Apps
Suggested Answer

bad key authorization token

(1) ShareShare
ReportReport
Posted on by 35
Recently, some of our flows have stopped functioning due to authorization token validation errors. The issue is challenging because there are no failed flow runs recorded, the flows simply stop working, and we become aware of the problem through user complaints.
When a connection is created, Microsoft assigns it an expiration date. Once that token expires, the connection becomes invalid and is marked as "Invalid connection." To restore functionality, we need to manually open the flow and create a new connection using the same account, which effectively renews the token.
Is there a way to retrieve the expiration date of our technical user account so we can proactively manage and renew it before it expires?
 
The error message:
Error from token exchange: Bad Key authorization token. Token must be a valid JWT signed with HS256 Failed to validate token: IDX10249: X509SecurityKey validation failed. The associated certificate has expired
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     
     

    You're encountering a token expiration issue in Power Automate flows, especially when using service accounts or technical users. Here's a breakdown of what’s happening and how to proactively manage it.


    🔍 Root Cause

    The error:

    Error from token exchange: Bad Key authorization token. Token must be a valid JWT signed with HS256
    Failed to validate token: IDX10249: X509SecurityKey validation failed. The associated certificate has expired.
    

    This indicates that the OAuth token or certificate used to sign the token has expired. Power Automate uses stored tokens for connections, and these tokens can silently expire without triggering a failed flow run—especially if the flow isn’t triggered frequently.


    ✅ Key Insights from Microsoft

    1. Token Expiry Behavior:

      • Most OAuth tokens in Power Platform expire after 90 days  .
      • If the token is revoked (e.g., due to password change, MFA policy, or certificate expiry), the connection becomes invalid.
      • Power Automate does not proactively refresh tokens unless a flow run fails and marks the connection as broken .
    2. No Built-in Expiry Date Visibility:

      • Currently, Power Automate does not expose token expiration dates in the UI or via API.
      • You must rely on manual monitoring or flow run failures to detect expired tokens.

    🛠️ Recommended Solutions

    1. Proactive Monitoring Flow

    Create a scheduled flow that:

    • Calls the Power Platform Admin API to list all connections.
    • Filters for connections with status = Invalid.
    • Sends an alert (email or Teams) when a connection is broken.

    This won’t give you the expiration date, but it will notify you as soon as a connection breaks.

    2. Use Service Principal (App Registration) Instead of User Account

    • Register an Azure AD App and use client credentials flow.
    • This avoids token expiration due to password or MFA changes.
    • You can manage certificate expiration centrally in Azure AD.

    3. Rotate Certificates Before Expiry

    If you're using certificate-based authentication, monitor the certificate expiry in Azure:

    • Go to Azure Portal > App Registrations > Certificates & Secrets.
    • Set up alerts for certificate expiration.

    4. Manual Token Refresh

    If using a user account:

    • Periodically re-authenticate the connection manually (e.g., every 60–75 days).
    • You can do this by clicking “Switch account” and logging in again with the same credentials.

    🧪 Workaround for Now

    Until Microsoft provides a way to view token expiration:

    • Document all flows using service accounts.
    • Set a calendar reminder to re-authenticate connections every 60–75 days.
    • Use the Power Platform Admin Center to monitor connection health.
     
    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard