I have following problem - I'm using named credentials with auth provider to send offline conversion to Google Ads.
My auth provider setup:
Provider Type - Open ID Connect
Name - Google API
URL Suffix - Google_API
Consumer Key - ***.apps.googleusercontent.com
Authorize Endpoint URL - https://accounts.google.com/o/oauth2/auth?access_type=offline&prompt=consent
Token Endpoint URL - https://www.googleapis.com/oauth2/v4/token
Default Scopes - openid
My named credential setup:
Url - https://adwords.google.com/api/adwords/cm/v201809/OfflineConversionFeedService
Scope - openid https://www.googleapis.com/auth/adwords
Generate Authorization Header - checked
My app at google contains redirect_uri from salesforce and in "APIs & Services" I have enabled "Google Ads API".
When I edit named credential and "Start Authentication Flow on Save" and enter my google credentials, my integration works for 1 hour. I receive 200 and can see that Google Adwords received my data.
After na hour I receive;
"System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: [AuthenticationError.OAUTH_TOKEN_INVALID @ ; trigger:'<null>'] faultcode=soap:Client faultactor="
When I reauthenticate in named credentials once again it start to again work for another hour.
Have you got guys any ideas what I'm doing wrong?