Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

Hi All,I have created a developer account and created a demo  of Connected Apps. I enabled the OAuth and now I am trying to get the access token by using client the id and client secret and i am getting the following error{    "error": "invalid_client_id",    "error_description": "client identifier invalid"}

6 answers
  1. Feb 1, 2024, 8:51 AM

    Hi, 

     

    The error message "invalid_client_id" indicates that the client identifier (client ID) you're using to obtain the access token is not recognized or is incorrect. Here are a few steps you can take to troubleshoot and resolve the issue:

     

    Verify Client ID and Client Secret:

    Double-check the client ID and client secret values you're using in your OAuth authentication request. Ensure that they match the values configured for your Connected App in your Salesforce developer account.

     

    Ensure Correct OAuth Endpoint:

    Make sure you are sending the OAuth authentication request to the correct endpoint URL. For Salesforce, the OAuth endpoint URL is typically something like https://login.salesforce.com/services/oauth2/token for production instances or https://test.salesforce.com/services/oauth2/token for sandbox instances.

  2. Eric Burté (DEVOTEAM) Forum Ambassador
    Jan 9, 2024, 11:06 AM

    Hello @Bharath Kumar have you enabled oAuth settings during connected app creation ?

    Have you waited a bit, as requested, between connected app creation and first call ? Eric

  3. Divya Chauhan (Kcloud Technologies) Forum Ambassador
    Jan 9, 2024, 10:55 AM
  4. Feb 14, 10:29 PM

    I also faced the same error. Even though all the details were correct. 

     

    Solution worked for me : On postman app, Under Configure New Token I updated Client Authentication = 'Send Client Credentials in body'. And it works for me. 

     

     

    I also faced the same error. Even though all the details were correct.

     

     

  5. May 3, 2024, 5:19 AM

    solution : use domain-url as loginUrl instead of test.salesforce.com 

     

    i asked my client to update api implementation on their side, there was no other alternative.

    but some integrations still fail with above soln. e.g. IDE's

  6. Jan 17, 2024, 4:08 PM

    Hi @Bharath Kumar, I Hope you are doing well.

     

    I am from the Trailhead help team. May I request you please let us know if any of the above responses helped you resolve the issue? If yes, kindly share the solution that helped you resolve the issue or please make sure to mark the response which helped you to resolve your query as 'Best Answer' so that it might help the fellow Trailblazer's who are facing the similar issue.

     

    Else, please let us know the Trailhead module/badge that you are working on so that we can go ahead and create a case on behalf of you and can assist accordingly.

     

    Kind Regards,

    Sathvika T

    Trailblazer Help

0/9000