Skip to main content

Hi all,

 

I have a requirement where we are integrating Salesforce with an external system. It is a 1-way communication where SF will use their API to pull in the necessary data. For authorization purpose they are using oAuth 2.0 Client Credentials with certificate (Microsoft oAuth link). They have provided us with the following information

1. Client ID

2. Tenant ID

3. .pfx certificate

4. Token Endpoint

5. scope

6. app endpoint.

 

I have tried a couple of ways using named credentials, but not able to establish the connection.

 

I would highly appreciate any help here on how to achieve this using salesforce. 

Thank you,

Aiswarya

 

#Identity & Access Management #Salesforce Developer #Named Credentials #Integration #TrailblazerCommunity #Advanced Administrator

5 respostas
  1. 1 de mar. de 2024, 20:21

    Steps taken so far:

    1. Converted .pfx certificate into JKS keystore file using openssl as pfx file format is not compatible with salesforce

    2. Uploaded the certificate into the client and key management setup

    3. Created an external credential with authentication protocol type as Client credentials with JWT assertion.

    4. Configured the JWT claims.

    5. Created a named credential and linked it with the external credential.

    6. Apex code snippet to test the connection.

    7. The response received was status code = 403 which indicates the credentials we are sending are wrong.

     

    Microsoft requires the following information in request body to authenticate.

    1. Client_assertion_type : available

    2. Grant_type - available

    3. Client_assertion - NOT AVAILABLE

    4. Scope - available

    5. Tenant - available

    6. Client_id - available

     

    The main questions are:

    1. does Salesforce generate the client_assertion and send it in the request or do we need to generate it?

    2. If we need to generate, what is the way to do this in Salesforce or Apex?

     

    #Integration #Salesforce Developer #Identity & Access Management #Named Credentials #Advanced Administrator #TrailblazerCommunity

0/9000