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 for S...
Power Apps
Answered

Custom Connector for Salesforce with OAuth 2.0 Issues

(0) ShareShare
ReportReport
Posted on by 25

Hello Everyone,

 

My organization is using SSO for our Salesforce instance, so I am unable to use the OOTB Salesforce Connector. Instead, I have created a Custom Connector that uses an OAuth 2.0 flow with a Connected App i've set up within Salesforce. When I test the connection, the initial connection succeeds with no issues, and I can also verify this in the Salesforce user logs. However, when I try to test an Operation, I am getting:

[{
"message": "Session expired or invalid",
"errorCode": "INVALID_SESSION_ID"
}]

 

It is difficult for me to tell where the breakdown is occurring, as the Operation request is calling the azure-apihub.us with an access token that does not correspond to the Salesforce access token. I've followed the Microsoft troubleshooting steps here to confirm that my OAuth 2.0 settings are configured correctly: https://support.microsoft.com/en-us/topic/verifying-oauth-configuration-for-custom-connectors-d733fdb9-6108-4199-b4f5-06e99b02d10f

 

I am able to obtain an access token using the same configuration patterns I am setting in my Custom Connector, and use it to make the equivalent 'Operations' (API Requests) in Postman. I am therefore stumped and not sure where else I may be able to look to determine where the problem may be in the flow. Any help would be greatly appreciated. I will post my sanitized settings, maybe someone is able to see something that I cannot.

 

Here is my Connector security configuration. Just a note: I am having to use Generic OAuth 2.0 as the Identity Provider instead of Salesforce, as the Salesforce Identity Provider throws an unknown exception with Salesforce after I complete the SSO flow. This issue was also reported here, with what looks like a working resolution: https://powerusers.microsoft.com/t5/Connecting-To-Data/Custom-Connector-to-Salesforce-and-Refresh-Token-Issue/td-p/194982

 

scriptkat_0-1626470890285.png

Here is the definition of my Operation:

scriptkat_1-1626470983053.png

 


Here is the response:

scriptkat_2-1626471033900.png

 

Verification that Connection is Connected:

scriptkat_3-1626471178070.png

 

 

Here are my Connected App settings, if it helps (i've confirmed I can communicate with the Connected App using Postman, and the initial Connection establishes correctly with the Connected App):

scriptkat_4-1626471285208.png

 

Any and all help appreciated - thank you!

Categories:
I have the same question (0)
  • scriptkat Profile Picture
    25 on at

    This fixed my issue; thank you so much for the second set of eyes!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#2
11manish Profile Picture

11manish 186

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 105 Super User 2026 Season 1

Last 30 days Overall leaderboard