1

I'm having this issue with my custom integration to Salesforce from an Azure function right now. For some reason when I test locally and use the local endpoint with Postman I can authenticate with Salesforce just fine but when I publish my Azure function to the cloud and I swap out the endpoint my authentication fails for Salesforce. The exact error message being authentication failure.

At first I thought there must be something wrong with my IP settings for the connected app in Salesforce but I've tested setting Relax IP Settings as well as not defining a Trusted IP Range for OAuth Web server flow and still no success. Here are a couple of screenshots of my settings.

IP Info OAuth Settings

Any ideas why I can authenticate locally but not once I publish to my cloud service in Azure? (I'm using SalesForceSharp to authenticate if that makes any difference)

tokyo0709
  • 1,897
  • 4
  • 28
  • 49

1 Answers1

2

Finally figured out what the disconnect between my cloud environment (Azure) and Salesforce was when I dug into my login history in Salesforce and found attempts to login from an insecure location.

Apparently different SSL/TLS defaults are setup for local versus cloud environments.

https://github.com/Azure/Azure-Functions/issues/482

Once I input this line at the top of my function and published everything got back to working again.

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
tokyo0709
  • 1,897
  • 4
  • 28
  • 49