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
Bhojraj DhakateBhojraj Dhakate 

I want to increase token valid for...

Hi All,
I am facing issue while retrieving token from salesforce to servicenow.

I am getting "Refresh Token = Null and Token Valid for : 0".

Can anybody help me how to increase the token span and how to get refresh token from salesforce to servicenow.
From Salesforce Side:

Salesforce token field from app

From ServiceNow Side: 
Servicenow response from salesforce

Khan AnasKhan Anas (Salesforce Developers) 
Hi Bhojraj,

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.

Thanks and Regards,
Khan Anas
Bhojraj DhakateBhojraj Dhakate

Hi Anas,

Thanks for your reply.

I did the same configuration as you said. Now i am getting following error.

User-added image
User-added image
I am havent receiving any Access token, Token expiry, Refresh Token.
Kindly suggest. 

Thanks,
Bhojraj