How to setup Named Credential in Salesforce for Microsoft?
To setup Named Credential in Salesforce for Microsoft, get the Client Id, Client Secret and Tenant Id from the Azure Portal. Note: Tenant Id should be used in the Auth. ....
To setup Named Credential in Salesforce for Microsoft, get the Client Id, Client Secret and Tenant Id from the Azure Portal. Note: Tenant Id should be used in the Auth. ....
Get the Tenant Id, client secret value(not the id). Sample Code: String strEndPoint = 'https://login.microsoftonline.com/{Enter_Tenant_Id}/oauth2/v2.0/token'; String strBody = 'grant_type=password&scope=https%3a%2f%2fgraph.microsoft.com%2f.default'; strBody += '&client_id={Enter_Client_Id}&client_secret={Enter_Client_Secret}'; strBody += '&username={Enter_Username}&password={Enter_Password}'; HttpRequest req = new HttpRequest(); ....
Get the Tenant Id, client secret value(not the id).Sample Code:String strEndPoint = 'https://login.microsoftonline.com/{Enter_Tenant_Id}/oauth2/v2.0/token';String strBody = 'grant_type=client_credentials&scope=https%3a%2f%2fgraph.microsoft.com%2f.default';strBody += '&client_id={Enter_Client_Id}&client_secret={Enter_Client_Secret}';HttpRequest req = new HttpRequest();req.setEndpoint( strEndPoint );req.setMethod( 'POST' );req.setHeader( 'Content-Length', String.valueOf( strBody.length() ) ....
Get the Tenant Id, client secret value(not the id).Do POST Call to get the access token.
Get the Tenant Id, client secret value(not the id).Do POST Call to get the access token.