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
RJ12RJ12 

Named Credential issue: The authentication provider didn't provide a refresh token

I configured Connected App, OAuth, named Credential to establish a REST API call to Salesforce Tooling API.

I'm seeing this warning on Named Credential and keep losing access to it. Keep getting an Invalid Session-Id error every few hours.

"The authentication provider didn't provide a refresh token. If the access token expires, your org won't be able to access this named credential."

I tried giving Named Credential scope as "refresh_token full" but it failed to authenticate the named credential.

Connect App:
User-added image

Auth Provider:
User-added image

Named Credential:
User-added image

AbhinavAbhinav (Salesforce Developers) 
Have you checked below blog? 

https://www.infallibletechie.com/2017/05/the-authentication-provider-didnt.html

If you face the below issue in Named Credential, make sure Default Scope is set in Auth. Provider.

 
RJ12RJ12

@Abhinav,

Tried giving the same scope in Auth provider, still, I'm seeing the warning message in Named Credential.