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
Miles NashMiles Nash 

Salesforce OAuth 2.0 Auth. Provider not getting new access token

Hi all,

I have the following Auth Provider:

Auth Provider
I have successfully authenticated with the provider using a named credential:

Named Credential
When I use this named credential in Apex callouts, I worked fine until the access token expires.  At this point, I get 401s repeatedly until I edit and save the named credential again (I have "Start Authentication Flow on Save" ticked).

This is a dealbreaker for the feature I am developing in terms of production use.  Please can anyone advise what I can do?

Many thanks,

Miles
ashwini bhattashwini bhatt
Hi Miles Nash,

Is that your user credentials changed?? 
If Yes then you have to authenticate once again with new credentials. 
Miles NashMiles Nash
Hi Ashwini,

No the credentials haven't changed.
ashwini bhattashwini bhatt
Is there any proxy server configured in network that is throwing 401 error...