function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Łukasz LelakowskiŁukasz Lelakowski 

Access Token stopped working - Connection App problem - INVALID_SESSION_ID

Hi,
I'm facing a problem with one of my Sandboxes. Today I noticed that Access Token received from Connected App doesn't work (Session expired or invalid - INVALID_SESSION_ID). It's weird because everything was working fine on Friday. I created another app, but it still has the same problem. I also created Connected App on my private Developer Org and I still can't retrieve any data. I'm suspecting, that it can be general Salesforce problem, do you have the same problem with your connected apps?

Thanks in advance.
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Łukasz,

Greetings to you!

Your app needs permissions (scope) to have the ability to use refresh tokens.
In Setup > Quick Find > App Manager >, click the "Edit" link for your Connected App and add the scope "Perform requests on your behalf at any time (refresh_token, offline_access)".

Once this has saved (you may have to wait a while), you will be able to change the value for the refresh token policy.

Reference: https://salesforce.stackexchange.com/questions/69161/refresh-token-policy-locked-to-immediatly-expire-token

Also, please refer to below links which might help you further with the above issue.

https://salesforce.stackexchange.com/questions/65590/what-causes-a-connected-apps-refresh-token-to-expire

https://salesforce.stackexchange.com/questions/73512/oauth-access-token-expiration

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas