A Named Credential with an OAuth Authentication Provider is the optimal way for a developer to implement the authentication to the REST endpoint. A Named Credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. An OAuth Authentication Provider allows the developer to use an external service that supports OAuth 2.0 as the identity provider for the Named Credential. This way, the developer can avoid hardcoding credentials or tokens in the code and leverage the OAuth 2.0 protocol to securely authenticate each Salesforce user with the document storage system34. Reference: Named Credentials as Callout Endpoints, Authentication Providers, OAuth 2.0, Apex Web Services and Callouts