Troubleshooting Salesforce OAuth 2.0 Connection Issue with Invalid Client Secret Error

Which IIQ version are you inquiring about?

Unsure

Please share any images or screenshots, if relevant.

Share all details related to your problem, including any error messages you may have received.

While connecting with Salesforce basic connection is working fine but when it comes for OAUT2 connection and I am using the Grant Type = Password
I have provided every detail and refreshed the client id and client secret multiple times. But still, it is showing that I have an invalid client secret.

Did anyone faced this issue before?

Hi @vkhare ,

Are you applying the correct client secret? Can you verify it with the app team.

1 Like

Hi Kavindar,
Thank you so much for the response.

Yes I did actually. I checked with Ctrl F and paste the key and secret. It shows that you have 1 matched. It means client secret and key is correct. I am still not sure how to resolve this. It’s been 15 days.

Can you confirm if firewall for *. salesforce.com

Thank you so much Vishal for replying to this issue.

Just, Correct me if I am wrong. If there’s a firewall we use the Password+Token to bypass it. This is the document I am following.

Yes, I think some restriction can be added to service account too.

@vkhare,
Is this resolved ?

No Vijay.

Still we’re having the issue with the OAuth 2.0

image002.png

Did you curl from iiq machine test.salesforce.com / login.salesforce.com on 443 to see if the connectivity can be established ?

I am using my custom path for the test.salesforce.com

Do we need to use test.salesforce.com instead of custom Sandbox URL?

if you configured custom url and and disabled standard URL and you can curl your custom url .
What is URl configured in “Salesforce URL” Application configuration ?

1 Like

Try this for your teat.salesforce,com

<Attributes>
<Map>
<entry key="OAuth2TokenURL" value="https://test.salesforce.com/services/oauth2/token"/>

<entry key="afterProvisioningRule"/>
<entry key="aggregationPartitioned">
<value>
<Boolean></Boolean>
</value>
</entry>
<entry key="aggregationType" value="account"/>
<entry key="audience"/>
<entry key="auth_type" value="OAuth2"/>
<entry key="beforeProvisioningRule" value="PineLabs_Salesforce_DisableOperation_BeforeOperationRule"/>
<entry key="clientId" value="hidden"/>
<entry key="clientSecret" value="hidden"/>
<entry key="compositeDefinition"/>
<entry key="createContacts">
<value>
<Boolean></Boolean>
</value>
</entry>
<entry key="customTimeOut"/>
<entry key="d_expiry"/>
<entry key="encrypted" value="clientSecret, private_key, privateKeyPassword, refreshToken"/>
<entry key="excludeFrozen">
<value>
<Boolean></Boolean>
</value>
</entry>
<entry key="grant_type" value="Password"/>
<entry key="isActive">
<value>
<Boolean></Boolean>
</value>
</entry>
<entry key="issuer"/>
<entry key="nativeChangeDetectionAttributeScope" value="entitlements"/>
<entry key="nativeChangeDetectionAttributes"/>
<entry key="nativeChangeDetectionEnabled">
<value>
<Boolean></Boolean>
</value>
</entry>
<entry key="nativeChangeDetectionOperations"/>
<entry key="noPermissions" value="false"/>
<entry key="operations" value="Create, Modify, Delete, Enable, Disable, SetPassword"/>
<entry key="password" value="hidden"/>
<entry key="privateKeyPassword" value="hidden"/>
<entry key="private_key_to_update"/>
<entry key="refreshToken" value="hidden"/>
<entry key="serverUrl" value="https://host-uat.sandbox.my.salesforce.com/services/Soap/u/56.0/00DH10000003YKE"/>
<entry key="sessionId" value="hidden"/>
<entry key="subject"/>
<entry key="sysDescriptions">
<value>
<Map>
<entry key="en_US" value=""/>
</Map>
</value>
</entry>
<entry key="templateApplication" value="Salesforce Template"/>
<entry key="url" value="https://test.salesforce.com"/>
<entry key="user" value="usenraname"/>
</Map>
</Attributes>

It worked. I had to remove two parameters from the XML file. Server URL and session id. It worked like a charm. One more thing In salesforce even if you’re putting FULL Access you need the specifically put the Refresh token permissions to get the refresh token. It was very weird.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.