appsmith
appsmith copied to clipboard
[Bug]: Salesforce Auth Token doesn't refresh automatically
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
App Link: https://internal.appsmith.com/app/license-tracker/clients-645b6543a56f84769dcbc32d/edit Issue Description: https://theappsmith.slack.com/archives/CNQ9Q91C0/p1702972094026239
Steps To Reproduce
https://theappsmith.slack.com/archives/CNQ9Q91C0/p1702972094026239
Public Sample App
No response
Environment
Production
Issue video log
No response
Version
v1.9.59-SNAPSHOT
Closing this completed. Please check epic https://github.com/appsmithorg/appsmith/issues/30826
Reopening this, as the issue is still reproducible on the production environment. cc: @tomjose92 @sneha122 @rohan-arthur
Update: Tested by creating an app on Appsmith Cloud with 3 queries setting the token refresh time to 600 seconds. The app is working for the last 48 hrs. https://www.notion.so/appsmith/Salesforce-355d3963e05d4428b570b06e089a1001?pvs=4
The salesforce refresh OAuth token flow was failing because the configuration for salesforce OAuth was not correctly done in Appsmith.
The Send Scope With Refresh Token
dropdown had to be set as No
.
I have added all the relevant information for configuring salesforce here.
https://www.notion.so/appsmith/OAuth2-How-and-what-01c224ee730c4b77a79459256f0a4a9d?pvs=4#8f4bb462378b4e909c5f9e5a79029c8d
cc: @sneha122 @rohan-arthur
The application has stopped working after 2 days hence reopening this issue.
Our hunch is that the current issue why apps are failing is due to this: https://salesforce.stackexchange.com/questions/65590/connected-app-avoiding-a-limit-on-a-number-of-issued-tokens-token-expiration The above question has 70 upvotes and is a widely faced issue with salesforce and we are facing the exact same behaviour. We are further drilling down onto this.
Update: We are getting the same error from Salesforce after 1-2 days. Here is the screenshot of the error log from my local system. The logs are not informative enough. It is related to this https://github.com/appsmithorg/appsmith/issues/30239#issuecomment-1970802839
Had enabled the refresh token rotation in salesforce on 29th Feb, 2024 at 5 pm IST. The idea behind doing this is here
Update: After enabling the refresh token rotation in salesforce, the appsmith app is working fine since the last 20 hours.
The expires_in timeout in appsmith datasource configuration is set to 120 seconds. The usage count in the salesforce dashboard stands at 26 now. (Everytime the refresh token api is hit this count increases by 1).
Update: The appsmith app is working fine since the last 28 hours. The usage count in the salesforce dashboard has gone up to 77 now!
Update: The appsmith app is working fine since the last 3 days.
The usage count stands at 85 now.
This marks the permanent fix for this issue! The salesforce-connected app is working perfectly fine auto refreshing the tokens.