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

Community site session details

Session Id :
Power Apps - Connector Development
Answered

Custom Connector Token Fails after 1 hour.

(0) ShareShare
ReportReport
Posted on by 19
I created a custom connector that users Azure AD Authentication type. The custom connector works correctly, but after 1 hour, it fails to work. This is the error I get
 
{
  "code"401,
  "message""Unauthorized"
}
 
Looks like your flow's abc@myemail.com connection needs to be signed-in again. The most common cause is a changed password or a policy set by your tenant administrator. Connections may also require reauthentication, if multi-factor authentication has been recently enabled for your account.
 
Even, If I reauthenticate the connection, it does not work until I create a new connection. Then it works again for 1 hour and fail. I need help on how to fix this please
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    50,217 Super User 2025 Season 2 on at
    Custom Connector Token Fails after 1 hour.
     
    Really need to understand the full context of the implementation of the custom connector as well as the usage of it within the scenario.
     
    It failing... that can happen for many reason.
     
    So when you say it works, in what context from what technology?
     
     
  • Verified answer
    UU-21041832-0 Profile Picture
    19 on at
    Custom Connector Token Fails after 1 hour.
     
    So I was able to resolve the issue. So the issue was, I created a Custom Connector that is supposed to Post Data to an ERP System. I created App registeration and also scope in Azure, then used OAuth2 (Generic OAuth) Authentication method in my custom connector. Once I create a new connection and run the custom connector, I am able to post  data to the the ERP system from my custom connector, however, the connection that I created only last for 1 hour before it's token expires. What I noticed was that the Access token that  is generated when I create a new connection expires after one  hour. So I needed a refresh token to be auto generated so that the connection is not revoked after 1 hour. 
     
    What I did was, in my App registration in Azure, Under API permission, I added New Permission, selected Microsoft Graph, and checked offline_access. This offline access is what generates a refresh token, hence preventing my connection from expiring. I also added the offline_access to my custom connector as scope and that fixed the issue. This docs/articles helped me. 
     
  • Michael E. Gernaey Profile Picture
    50,217 Super User 2025 Season 2 on at
    Custom Connector Token Fails after 1 hour.
     
    That's great. This is actually a problem that happens constantly for non-custom ones so don't feel bad :-)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 790 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 473

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 383 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics