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 / Custom Connector Token...
Power Automate
Unanswered

Custom Connector Token Refresh?

(0) ShareShare
ReportReport
Posted on by 92

I've created a cusom connector to Salesforce (the 'Premium' Flow connector doesn't support a couple API features I need). It works fine, but stops working after 4 hours, which is the session timeout setting for our Salesforce org. I need my connector to get a refresh token but I'm not sure how to do it. Has anyone gotten a Flow custom connector access token refresh from Salesforce working?

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @Bjorn 


    I just stumbled on your request. You've been waiting a while for a reply.

    Were you able to solve it? Can you post the solution so that we can all learn from it?

    If you still need help, please let me know what changed.

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • Verified answer
    Bjorn Profile Picture
    92 on at

    Hi @manuelstgomes,

     

    I'll post this in case it helps anyone else. I finally gave up with my custom connector and just make direct HTTP requests. I post my client_id, client_secret, username, and password (for Salesforce, that's password+token) to their token endpoint. The return contains an access_token that I store in a variable and use in the header of my subsequent API requests. This avoids the token refresh issue I was having and is more flexible (I can make any number of different API calls via HTTP, whereas if I used a custom connector I would have had to define them each as unique actions).

     

     

    SalesforceHTTP.png

  • manuelstgomes Profile Picture
    6,625 on at

    Hi @Bjorn 

     

    Thanks for posting the solution. Well done!

     

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    ​
    Cheers
    Manuel

  • JacksonOng Profile Picture
    51 on at

    HI, I am trying to do the same thing, but using the http post is just too much work for multiple API calls. Did anyone find a better solution? 

  • Aysan Profile Picture
    271 on at

    I am working on kind of the same solution, but I want to connect my powerapp to Netsuite, Not sure how to trigger the flow for each session and start the timer, 

  • NagyRobert77 Profile Picture
    2 on at

    so i turned my head around for 2 days to find a solution to use PowerAutomate with refreshed access tokens and i figured out a solution, but unfourtunetly without Custom Connector:

    So my scenario is that i need to generate a new acces token with the refresh token that i generated at authorization. Each time i want to create a call i use the refresh token to get new access token, then i parse and use it in the next http call in powerautomate.

     

    1. Authorize your API with any browser (chrome, edge...etc) (Read oauth2 Authorization documentation from your app)

    2. Generate Access token and Refresh token using API Documentation and using Postman. (Read oauth2 Generate tokens documentation from your app) *this is your first token that expires in x minutes.

    3. Create new flow in power automate starting with any trigger you like.

    4. Add HTTP Step and select POST and paste in your URI that gives you the new access token. The refresh token generates the new access token. Refresh token you get from step 2 with Postman. (Read oauth2 Refreshing tokens documentation from your app)

    5. Parse json response.

    6. Add HTTP step and use new Acces Token from step.5

     

    Each time you have a trigger all 3 steps are mandatory to receive fresh access token.

    Done, you can call any API always having the refreshed access token.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard