https://linen.dev logo
Issue with Salesforce – Sandbox userinfo request a...
# 🖥│support-forum
b
I’m using the Salesforce tool in Composio and customized the subdomain to test against a sandbox instance. - Authentication works fine, but the requests fail afterwards. - On inspecting the flow, I noticed the userinfo request is still being made to the default
login
subdomain
instead of the modified sandbox subdomain. - As a result, I always get errors for sandbox users, while everything works correctly for production instances. Please see the attached images for reference Could you please check if the tool is properly handling the customized subdomain for sandbox environments? I have checked the same in postman by altering the subdomain specific to the one that is on account, and I am able to get the response as expected. Please fix this on priority. @udaysidagana https://cdn.discordapp.com/attachments/1422921124563386428/1422921125104582771/image.png?ex=68de6e10&is=68dd1c90&hm=c9632d9040eec4df7811d5549c842d7f7b01b55e3847e07d35a3421644cfe158& https://cdn.discordapp.com/attachments/1422921124563386428/1422921125851303966/image.png?ex=68de6e10&is=68dd1c90&hm=2fc0c53e7c9b6c7e8030febcdc23053a6d3da2492f4b00354097c5697358488a& https://cdn.discordapp.com/attachments/1422921124563386428/1422921126249496606/image.png?ex=68de6e11&is=68dd1c91&hm=c182316aa5fe60f5ae30378a733f4202826e14865fd30936cfd59e13d36efdf6& https://cdn.discordapp.com/attachments/1422921124563386428/1422921126757138463/image.png?ex=68de6e11&is=68dd1c91&hm=463460f28b8eac7d5601e64b965611d05ea411ceb69e5e705d16569d8eac4932&
c
Hey, we just pushed a fix for the above! Could you give it a try and let me know if you face any issues.
b
Hey Karthikeya, I am still facing the issue, do I need to re-initiate the connection ?
c
Ideally should work without any changes. What action is this?
b
Create lead with specific type
SALESFORCE_CREATE_LEAD_WITH_SPECIFIED_CONTENT_TYPE
Why is the request still routing to
login.salesforce.com
it should ideally go to
{{subdomain}}.salesforce.com
right ?
c
Can you please share the connected account ID? You could also try making a new connection and let me know if you are still facing the same issue.
b
Here is the connected_acc_id:
ca_V8ZacPPeD31j
Please let me know once noted, I will delete it from here .
c
Hey, sorry for the delay! Looks like you have passed "test" as the subdomain instead of the actual subdomain of the salesforce instance and hence, you're facing the issue. Could you please pass the right subdomain and give it a try?
b
I am using the sandbox instance of salesforce and with the subdomain as "test" we are able to authenticate with the custom subdomain at the login screen. But, when I looked at the logs for execution the salesforce authentication error with Bad_id appears. I have checked the logs on composio and found that the oauth2/userinfo request is going to login.salesforce.com instead of test.salesforce.com, for non production instance it should use test subdomain right ?
c
While the authentication works with "test" as the subdomain, actions do not work and hence, we will need the actual subdomain of the sandbox instance. As of why we hit [login.salesforce.com](http://login.salesforce.com) instead of [test.salesforce.com](http://test.salesforce.com), earlier we used to have logic to construct the base_url before executing any salesforce but now we have removed it and ask for subdomain even before the connection is initiated. So if you use the subdomain instead of the "test", it should work as expected.
b
With actual sandbox subdomain, we are unable to authenticate the user (matter of fact we landed on error page with sandbox subdomain).
c
Could you share the connected account id of this/
b
Copy code
As of why we hit login.salesforce.com instead of test.salesforce.com, earlier we used to have logic to construct the base_url before executing any salesforce but now we have removed it and ask for subdomain even before the connection is initiated.
whatever the subdomain is, shouldn't we get oauth2/userinfo from the specified subdomain ? if it doesnot construct the base_url using
test
, then how come it works for other subdomains ?
Here one of the connected account id we tried
ca_aCk3a6X_bP2q
this as well
ca_7x9oyGqhBsvI
c
I just checked both the connections. It seems you have subdomain in the both cases and only this
ca_aCk3a6X_bP2q
was successful. Did you not complete the OAuth2 flow for this connection
ca_7x9oyGqhBsvI
? Can you executing the actions for this connection
ca_aCk3a6X_bP2q
and see if they are working?
Here is what I got the response using the above connected account id
c
Copy code
curl --location 'https://backend.composio.dev/api/v3/tools/execute/SALESFORCE_LIST_ACCOUNTS' \
--header 'x-api-key: xxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
    "version": "latest",
    "connected_account_id": "xxxxxxx",
    "arguments": {}
}'
Could you execute the above cURL with your api key and connected account id?
I am able to get the response in curl, but unable to get the response on platform and in our integration.
c
You might be using an old version of the tools and hence you need to specify the ""version": "latest" in all the requests you make.
b
Does this mean creating a new authconfig would fix the issue ?
a
Hey, not necessary. You just need to specify
version:latest
. Sharing some resources that might be helpful: Versioning: https://docs.composio.dev/changelog/2025/9/16
b
we are using agentic framework with latest composio sdk, so the tool execution is something the agent handles in the langgraph
@abhishekpatil4
a
Yeah, thats fine — you just need to configure at client initialization to use the latest version: https://docs.composio.dev/changelog/2025/9/16#python-sdk-v0811
b
can you confirm if a new authconfig would fix the issue @abhishekpatil4
creating the connection with newly added auth_config ?
Also, we have authconfigs that are created way back, and if we set the toolkit version to latest, wouldn't that conflict the older toolkits ?
would the connected account id of older toolkits/auth_configs be uneffected with the global version setting ?
@abhishekpatil4 can you help me with answers to above questions ?
a
ah my bad. Correction — In SDK the latest version will be used by default. In case of APIs you need to expllicitly specify it.
Let me know if you need any help, happy to hop on a quick call to fast-track this
b
Cool, let do it
@abhishekpatil4
a
Copy code
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIProvider

openai = OpenAI()
composio = Composio(
    api_key="", 
    provider=OpenAIProvider(),
)

tools = composio.tools.get(
    user_id="default", 
    tools=["GMAIL_SEND_EMAIL"]
)

response = openai.chat.completions.create(
    model="gpt-4",
    tools=tools,
    messages=[
        {
            "role": "user", 
            "content": ""
        },
    ],
)

result = composio.provider.handle_tool_calls(
    response=response, 
    user_id="default"
)
print("Result:", result)
b
SALESFORCE_CREATE_LEAD_WITH_SPECIFIED_CONTENT_TYPE
Hey @abhishekpatil4 , I have ran the above script in isolation with composio version 0.8.20 and I am able to see the version being added in parameters . We would try to debug from our end. Thank you for your time. https://cdn.discordapp.com/attachments/1422921124563386428/1423686252372164830/image.png?ex=68e136a5&is=68dfe525&hm=45c7d4e4ba87a3ffe6cc4a4277c6986b6ecfdbb254c9537f231053a7c89dded6&
2 Views