I'm in the process of integrating Salesforce with an external service. In our scenario, an LWC page calls a method in its Apex controller. This method then initiates an external callout to obtain a JSON object.
The integration procedure is as follows:
The client needs to call the authorization endpoint, providing the client ID, client secret, and scope to obtain an access token.
Once the token is obtained, a POST request is sent to the external service. This request includes the token, specific header parameters, and the necessary payload to fetch the JSON response.
I've been successful in executing these requests using Postman.
- How can I leverage Named Credentials and External Credentials for a secure implementation?
- Given that the access token expires every few hours, can Named Credentials manage its renewal based on the described scenario?
I prefer to avoid legacy Named Credentials. Unfortunately, I haven't been able to find comprehensive information on the new version of Named Credentials specific to this scenario.