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 / Custom Connector Token...
Power Apps
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
    53,969 Moderator on at
     
    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
     
    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
    53,969 Moderator on at
     
    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

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