Salesforce Connector - Error on Token Refresh
Description
Description:
Every time the Salesforce Token that is used in Alfresco needs to be refreshed the action is failing and giving an error inside the Lightning component (see alfresco.log).
Analysis so far:
Alfresco sends the following request to Salesforce:
2021-01-05 09:17:43,986 DEBUG [org.springframework.web.client.RestTemplate] [http-nio-8080-exec-6] HTTP POST https://test.salesforce.com/services/oauth2/token
2021-01-05 09:17:43,986 DEBUG [org.springframework.web.client.RestTemplate] [http-nio-8080-exec-6] Accept=[application/x-www-form-urlencoded, multipart/form-data, application/json, application/*+json]
2021-01-05 09:17:43,987 DEBUG [org.springframework.web.client.RestTemplate] [http-nio-8080-exec-6] Writing [{refresh_token=[xyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyx], grant_type=[refresh_token]}] with org.springframework.http.converter.FormHttpMessageConverter
The request is successful and delivers all the information, but Salesforce is not sending a Content-Type header when using "application/x-www-form-urlencoded".
The response is then interpreted as application/octet-stream what could not be handled.
The logic for that is inside the spring-social-salesforce library Alfresco used. And it seem to be an already known error as you can see in the Github repo of the library.
The Salesforce Connector is referencing an other version of that library, which does not have the fix for that behaviour available.
Could you please check if this could be added to the library Alfresco is using and also if its possible to switch to the other library as a workaround?
Environment
Testcase ID
Activity
please see above.
There is a plan to move to the upstream project in with our next release but again…see the above.
This hasn’t been reproduced in any of our testing. Can you ask them what type of Sandbox they are using? So we can try to match their environment?
While it hasn't been tested the upstream project should be compatible. All off the fixes/changes made in our fork were merged upstream a while ago.
We are still working on validating the other issues. They are either in progress or in our backlog of work.
This comment was left via Slack.
The customer asked:
Are there more details yet on the open questions from my side or workarounds/fixes or is it still under review?
The original question about the workaround was :
Could you please check if this could be added to the library Alfresco is using and also if its possible to switch to the other library as a workaround?