Q:

Third party wants to call Salesforce.Can we use named credentials in this case

i have a use case where Some code has been written in salesforce and Third party wants to call it.They are calling using rest like this.
https://xxx.com/services/oauth2/token?grant_type=password&client_id=12345&client_secret=12345&username=sandbox.username&password=password
Can i use Named credentials in this scenario.

A:

Named Credentials are only relevant for calls made from Salesforce to either Salesforce itself or some other platform. They cannot be used by outside callers into Salesforce.
When calling in to Salesforce from a third party, OAuth authentication is required unless you choose to expose an Apex REST service to the unauthenticated world via a Force.com Site. Naturally, doing so has significant security implications.
If the third party system is a different Salesforce instance, you can create a Named Credential in that instance and authenticate it via OAuth.

