We have several applications requesting and updating data in Salesforce through the rest api, this is all working fine on login.salesforce.com. we now are continueing development to test.salesforce.com and are facing regular issues with oAuth2 access

The behavior noticed is that on each request to test.salesforce.com/services/oauth2/token we get a new access token, while on login.salesforce.com we're getting the same accesstoken. Also the token we get back are not valid as then subsequent calls return 401 with "This session is not valid for use with the REST API"

I have checked settings for connected apps and remote access between login and test and they seem to be the same.

Has anyone experienced this behavior and how did you solve it?

  • Did you refreshed the sandbox from live ? And did the connected app refreshed successfully? This might be related to your problem salesforce.stackexchange.com/questions/45890/… . Salesforce has a bug in when refreshing connected apps – Mihai Neagoe Jan 12 '15 at 16:24
  • So these several applications fire seperate logins in test.salesforce? – Amit Bangad Jan 15 '15 at 7:15
  • They all do the oauth thing, meaning request token and then request data, the token is cached btw for some time but less than the session timeout – Gertjan Assies Jan 20 '15 at 8:43
  • @MihaiNeagoe refreshing the sandbox fixed the issue – Gertjan Assies Jan 30 '15 at 14:06

In both login as well as test go to : Administration Setup>Security Settings> Session Control

Please compare the session timeout and session settings sections over there.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.