Skip to main content

Hi everyone,

I'm facing an issue with integration Salesforce and Muleforce. I create a connected App in Salesforce with client_credentials and I'm trying to connect to Mulesoft with this acces. The acces is working via postman but not from Anypoint Studio or Code Build (I tried both).

 

I'm getting the following error : org.mule.runtime.api.connection.ConnectionException: OAuth authorization dance not yet performed for resourceOwnerId null.

 

Here my configuration :Error when trying to integrate Salesforce and Mulesoft regarding resourceOwnerIdI don't know what value to put in the field. 

 

Thank you !

3 respuestas
  1. 4 dic 2024, 10:31

    @Pierre-Nicolas Lemoine,

     

    When trying to connect MuleSoft to Salesforce, the OAuth authorization process has not been properly finished, as shown by the error message you are seeing, `org.mule.runtime.api.connection.ConnectionException: OAuth authorization dance not yet done for resourceOwnerId null`. To diagnose and fix this issue, follow these steps: 

     

    How to Fix the Problem

     

    1. Check Connected App Setup: - Make sure your Salesforce Connected App is set up properly. In particular, look at the following: 

    - OAuth Scopes: Verify that your Connected App settings have the required OAuth scopes (e.g., `Full access (full)`, `Access and control your data (api)`). 

    Callback URL: Make sure the callback URL is configured appropriately if you are utilizing the authorization code flow. 

     

    2. Significant Verification Technique: - Make sure you are using the appropriate authentication flow as you stated using `client_credentials`. If set up correctly, the client credentials flow should function without requiring user involvement. 

     

    Verify that the `client_id` and `client_secret` you are using in your MuleSoft application are valid. 

     

    3. Verify the configuration of Anypoint Studio or Code Builder: 

    Make that the Salesforce connector is set up with the appropriate authentication parameters in Anypoint Studio or Code Builder.

    - Make sure your Salesforce Connected App's OAuth setup matches any custom settings you may be utilizing. 

     

    4. Check Connection in Anypoint Studio: - Check whether Anypoint Studio's "Test Connection" option gives you any error messages or other information about what could be incorrect. 

    - If it doesn't work, look for any particular error messages in the detailed logs. 

     

    5. Examine API Versioning: Make sure your connection setup is utilizing the right API version. Unexpected problems can occasionally result from incompatible API versions. 

     

    6. Examine Logs for Additional Information: 

    Look for any more error messages or stack traces in the MuleSoft logs that can shed more light on the OAuth authorization failure. 

    Pay close attention to any logs pertaining to connection attempts and token retrieval problems. 

     

    7. Use Postman as a Reference: Considering that you indicated that Postman is used to establish the connection, contrast the request body and headers used in Postman with those set up in Anypoint Studio. Make sure they are precisely the same. 

     

    8. Look for Problems Particular to the Environment: 

    Make sure all configurations (such as connected app settings) are set up appropriately in the sandbox environment if you're working there. 

    - Check Salesforce for any security settings or IP restrictions that could be preventing MuleSoft requests from being processed.

     

    You should be able to locate and fix the problem causing MuleSoft and Salesforce's OAuth authorization to fail by following these steps. If issues still arise after attempting these fixes, think about contacting MuleSoft support or looking through community forums for more help catered to your particular configuration.

     

    Few link may help you 

    [1] https://stackoverflow.com/questions/19957636/connection-error-with-mule-salesforce-connector

    [2] https://docs.mulesoft.com/service-mesh/latest/troubleshoot-installation-issues

    [3] https://hightouch.com/docs/destinations/salesforce

0/9000