function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amit PPTAmit PPT 

How to allow access of salesforce REST APIs using external authentication (i.e. Azure AD) and not using Salesforce Authentication?


There are some Salesforce REST APIs which needs to be consumed by client application. The API Request should be externally authenticated by Azure AD using Azure AD's OAuth app registration and Salesforce OAuth2.0 authentication is not required. However Salesforce should be able to validate the Access Token provided by Azure AD by calling an Azure URL for token validation.

Please suggest if there is a way to achieve this without using Salesforce OAuth2.0 Authentication.
Krishna VKrishna V
Hello Amit, 

You can create a public site, add the apex class for the endpoint to the public site. This will allow access to your endpoint without auth. For the second part of the question, when the endpoint is accessed, you can configure your apex class to do the auth with Azure and confirm that the Access Token is valid before the actual logic is allowed to be implemented. Let me know this helps.