cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bjorn
Advocate IV
Advocate IV

Custom Connector to Salesforce and Refresh Token Issue

I'm hoping someone has had luck building a custom connector to Salesforce and can help me out with the OAuth part. I've got my custom connector working just fine, but my connection expires after 4 hours (our Salesforce org session setting) forcing me to manually reconnect. I've given the connected app full permissions that are reflected in the Flow scope, but it's not requesting a refresh token. I can't figure out how to do this in Flow, or if it's even possible? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Actually there is a way. I opened a support ticket and they helped me figure it out, I had the wrong token url (props to Rajat at Mindtree in Hyderabad!). I'll give details here in case it helps others.

 

You can indeed create a custom connector to Salesforce, but do not use Salesforce as the Oauth provider as one would assume, use 'Generic Oauth 2'. With that option selected, you can enter the unique urls you need for auth and token/refresh. 

 

2018-12-26_14-21-01.png

 

 

Here's where things get buggy. When you click 'Update connector', it changes the Identity Provider to Salesforce and the unique urls you entered are no longer there. They actually are there and are used in your connection, but are hidden from view making debugging difficult. I opened a bug fix for this UI issue.

 

2018-12-26_14-21-26.png

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @Bjorn,

 

As far as I understand it, there seems to be no way to achieve this.

Since your organization's settings are that the connection expires every four hours, the credentials are expired, so the connection needs to be manually updated.

There is no way for Flow to automatically update the connection. I am afraid there is no suitable way to solve your problem.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Actually there is a way. I opened a support ticket and they helped me figure it out, I had the wrong token url (props to Rajat at Mindtree in Hyderabad!). I'll give details here in case it helps others.

 

You can indeed create a custom connector to Salesforce, but do not use Salesforce as the Oauth provider as one would assume, use 'Generic Oauth 2'. With that option selected, you can enter the unique urls you need for auth and token/refresh. 

 

2018-12-26_14-21-01.png

 

 

Here's where things get buggy. When you click 'Update connector', it changes the Identity Provider to Salesforce and the unique urls you entered are no longer there. They actually are there and are used in your connection, but are hidden from view making debugging difficult. I opened a bug fix for this UI issue.

 

2018-12-26_14-21-26.png

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,459)