Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Salesforce Connector ( Lightning ) - Test Connection is Failing with getAccessToken null

IAM_99
Regular Contributor II
Regular Contributor II

Hi Team,

We are configuring Salesforce app ( Lightning ) followed steps  mentioned the connector documentation. Test Connection is failing ( we checked connector - troubleshooting steps -In POSTMAN its generating access token correctly),  here is the logs, any idea ?

 

DEBUG services.HttpClientUtilityService - Final connectionTimeoutConfig after guardRail validation: [connectionTimeout:10, readTimeout:120, writeTimeout:120, retryCount:3, retryWait:2]\n","stream":"stdout","time":"2023-02-02T17:40:25.179836408Z"}
DEBUG provisoning.SalesForceProvisioningService - callService url:\u003e\u003e\u003e\u003e\u003e\u003e https://b2c--uat.my.salesforce.com//services/oauth2/token\n","stream":"stdout","time":"2023-02-02T17:40:25.179887018Z"}
DEBUG services.HttpClientUtilityService - setting connection timeout to 10 seconds and request timeout to 120 seconds\n","stream":"stdout","time":"2023-02-02T17:40:25.180163126Z"}
DEBUG rest.RestUtilService - callService - responseStatusCode ::307\n","stream":"stdout","time":"2023-02-02T17:40:25.232631607Z"}
DEBUG provisoning.SalesForceProvisioningService - Error in getAccessToken:null\n","stream":"stdout","time":"2023-02-02T17:40:25.23274485Z"}
DEBUG println.PrintlnToLogger - Println :: \u001b[1;31m| Error \u001b[22;39mUnexpected character (T) at position 0.\u001b[m\n","stream":"stdout","time":"2023-02-02T17:40:25.232862836Z"}
DEBUG println.PrintlnToLogger - Println :: \u001b[1;31m| Error \u001b[22;39m\u0009at org.json.simple.parser.Yylex.yylex(Yylex.java:610)\u001b[m\n","stream":"stdout","time":"2023-02-02T17:40:25.233238077Z"}

[This post has been edited by a Moderator to remove sensitive information.]

14 REPLIES 14

sk
All-Star
All-Star

What is the connection JSON you have used?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

IAM_99
Regular Contributor II
Regular Contributor II

Salesforce default connector doesnt have ConnectionJSON.

riteshkumar
Saviynt Employee
Saviynt Employee

It could be because of incorrect URL for Salesforce. We had similar issue and it turned out to be Salesforce changes the URL at their end. It was fixed after changing to correct URL. 

IAM_99
Regular Contributor II
Regular Contributor II

Hi Ritesh - Its working in POSTMAN ( Access token generating ) ,

IAM_99_0-1675379673461.png

 

do you think its an issue with Salesforce ?

SB
Saviynt Employee
Saviynt Employee

Below is the link for the salesforce guide. Can you check if you have followed all the steps for Registering the Connector in Salesforce and the verify the value for your url and redirect uri

The logs show a responsecode of  307 which means the call is successfully being sent from Saviynt.

https://docs.saviyntcloud.com/bundle/SF-v2021x/page/Content/Preparing-for-an-Integration.htm


Regards,
Sahil

Yes, we had the same exact issue. Was getting tokens in postman but the connector was failing with same error message. 

IAM_99
Regular Contributor II
Regular Contributor II

Yeah Sahil, its the same connector guide from fresh desk, we followed the same and its working postman but not in test connection.

Can you let me some more inputs on below  - how to prove that its going fine from Saviynt

The logs show a responsecode of  307 which means the call is successfully being sent from Saviynt.

 

Note : Connector guide Document Correction Required -  step 2.Select Enable for Device Flow. vs Screenshot 

 

Manu269
All-Star
All-Star

Can you please confirm if the parameters CLIENT_ID/CLIENT_SECRET/REFRESH_TOKEN/REDIRECT_URI/INSTANCE_URL are configured correctly.

Also, consent for OAuth authorization is performed correctly?

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

IAM_99
Regular Contributor II
Regular Contributor II

Yeah Manu those are correct , POSTMAN screen shot has the same.

Can you elaborate this ?

consent for OAuth authorization is performed correctly?

Manu269
All-Star
All-Star

Its a pre requisite step to be followed for token generation.

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

IAM_99
Regular Contributor II
Regular Contributor II

yeah we have done that- so the  POSTMAN is generating token able to get users from api in postman.

rushikeshvartak
All-Star
All-Star

You have issue in URL it seem you have added two //


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

IAM_99
Regular Contributor II
Regular Contributor II

extra slash (/)  added from the instance URL, if  https://abc.salesforce.comi have removed that (https://abc.salesforce.com)as well PFB logs , but the error is same.  if urls is incorrect it should give 400,404 error instead of 307 - i am not get clue on why  is Saviynt to return 307 here

provisoning.SalesForceProvisioningService - callService url:\u003e\u003e\u003e\u003e\u003e\u003e https://xxxxxx--uat.my.salesforce.com/services/oauth2/token\n","stream":"stdout","time":"2023-02-03T20:54
services.HttpClientUtilityService - setting connection timeout to 10 seconds and request timeout to 120 seconds\n","stream":"stdout","time":"2023-02-03T20:54:22.512878844Z"}"
rest.RestUtilService - callService - responseStatusCode ::307\n","stream":"stdout","time":"2023-02-03T20:54:22.579408359Z"}"
provisoning.SalesForceProvisioningService - Error in getAccessToken:null\n","stream":"stdout","time":"2023-02-03T20:54:22.579475585Z"}"
println.PrintlnToLogger - Println :: \u001b[1;31m| Error \u001b[22;39mUnexpected character (T) at position 0.\u001b[m\n","stream":"stdout","time":"2023-02-03T20:54:22.579601436Z"}"
println.PrintlnToLogger - Println :: \u001b[1;31m| Error \u001b[22;39m\u0009at org.json.simple.parser.Yylex.yylex(Yylex.java:610)\u001b[m\n","stream":"stdout","time":"2023-02-03T20:54:22.579933639Z"}"

 

 

Then somewhere you have T in parameters thats issue


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.