1

Salesforce keeps track of the user login history like this. The Application column shows use the application that we have logged in through. So I am using simple-salesforce library to connect with Salesforce, It send a soap request with username, password and security token, so is there any way we can pass application so that we can know we have logged in from out application.

I created the OAuth application in Salesforce and enabled device flow and got a consumer key that is called client_id. I logged into salesforce with following parameter:

Salesforce("username", "password", "security_token", client_id="CONSUMER_KEY")

The XML request body looked like this:

<?xml version="1.0" encoding="utf-8" ?>
        <env:Envelope
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:urn="urn:partner.soap.sforce.com">
            <env:Header>
                <urn:CallOptions>
                    <urn:client>client_id</urn:client>
                    <urn:defaultNamespace>sf</urn:defaultNamespace>
                </urn:CallOptions>
            </env:Header>
            <env:Body>
                <n1:login xmlns:n1="urn:partner.soap.sforce.com">
                    <n1:username>username</n1:username>
                    <n1:password>password+security_token</n1:password>
                </n1:login>
            </env:Body>
        </env:Envelope>

XML Request header

{'SOAPAction': 'login', 'charset': 'UTF-8', 'content-type': 'text/xml'}

If anybody has Idea about this, I need some help.

1

1 Answer 1

1

At this time, it does not appear to be possible to set the application using simple-salesforce. I've tried setting a number of things in client code, and found none that will cause the application to be updated. Subsequently I contacted Salesforce support and received confirmation that it cannot be updated in current versions of their platform using the SOAP API (which is what simple-salesforce calls behind the scenes).

I was advised by Salesforce support to open an Idea for consideration in future releases: https://success.salesforce.com/ideaView?id=0873A0000003aXDQAY

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .