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-d733fd...
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-To...
Here is the definition of my Operation:
Here is the response:
Verification that Connection is Connected:
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):
Any and all help appreciated - thank you!
Solved! Go to Solution.
I found the following links that may be helpful. From the last link:
"There is a setting in Salesforce that may lead to issues where calls return “INVALID_SESSION_ID – Session expired or invalid”. If this is occurring, clear the the Session Setting Lock sessions to the IP address from which they originated check box."
https://help.openconnectors.ext.hana.ondemand.com/home/what-causes-invalid-session-id-messages
If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.
I found the following links that may be helpful. From the last link:
"There is a setting in Salesforce that may lead to issues where calls return “INVALID_SESSION_ID – Session expired or invalid”. If this is occurring, clear the the Session Setting Lock sessions to the IP address from which they originated check box."
https://help.openconnectors.ext.hana.ondemand.com/home/what-causes-invalid-session-id-messages
If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.
This fixed my issue; thank you so much for the second set of eyes!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.