I have to integrate Salesforce with an external app using OAuth2.0. I create Auth. Provider and Named Credential, authenticated successfully too.
But I'm getting one issue with Named Credential :
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.
With this issue I don't think the access token will be refreshed automatically, right?
What options do I have to get the access token once it expires?
I tried, getAccessToken(authProviderId, providerName)
but it keeps returning null.
String accessToken = Auth.AuthToken.getAccessToken('0SO5j000000sgZNGAY', 'Open ID Connect');