[Python] Trying to login with sts using Microsoft credentials in Salesforce via...

Discussão em 'Python' iniciado por Stack, Fevereiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    The standard method of entering a username, password, and security token results in an 'Authentication Failed' error. I believe that I first need to reach the correct login page to provide these details, but I'm unsure how to proceed.

    Here are the steps to log in to Salesforce through the web browser:

    Go to domain.my.salesforce.com Log in using STS (Single Sign-On) This redirects to login.onlinemicrosoft.com/... Enter the user credentials created in Azure AD Finally, the Salesforce homepage is displayed.

    How should I write the code for it in python?

    Here are the methods I tried:

    Created a 'New Connected App' as mentioned in many articles. Gave full access, and copy-pasted consumer key and consumer secret. There is a confusion on what should I put in the callback URL? I also edited the policy and gave the IP range in the Network Access.

    I also tried putting variations of parameters in Salesforce() function like OrgId, instance_url but didn't work.

    Continue reading...

Compartilhe esta Página