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.

I am trying to connect VS Code to  playground SF Org but getting below error. Can someone help on this ? 

 

Error authenticating with auth code due to: request to https://login.salesforce.com//services/oauth2/token failed, reason: self-signed certificate in certificate chain

 

This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

 

8 answers
  1. Jan 16, 2024, 5:55 PM

    After installing node.js it started working for me. Not sure what was the issue. 

    Even it's working on company's VPN

  2. Dec 10, 2023, 3:12 AM

    hello @Puneet Garg

     

    please try this

    The following solution worked for me:

    1. Run command prompt 𝐚𝐬 𝐚𝐝𝐦𝐢𝐧 (𝘚𝘵𝘢𝘳𝘵 > 𝘤𝘮𝘥 > 𝘙𝘪𝘨𝘩𝘵-𝘊𝘭𝘪𝘤𝘬 > 𝘙𝘶𝘯𝘈𝘴 𝘈𝘥𝘮𝘪𝘯)
    2. Run the command: 𝐧𝐞𝐭𝐬𝐭𝐚𝐭 -𝐚𝐨𝐧
    3. CTRL+F, to search for 𝟏𝟕𝟏𝟕
    4. Note the number displayed in the 𝐏𝐈𝐃 𝐜𝐨𝐥𝐮𝐦𝐧 in the same row where 1717 was found. In my case, it's 𝟒𝟔𝟒𝟖
    5. Open Task Manager > Click on Details Tab > Sort by PID
    6. Locate the number from step 4 (in my case 𝟒𝟔𝟒𝟖)
    7. Right-Click > End Task
    8. Go back to VS Code and run the command again "𝘚𝘵𝘢𝘳𝘵𝘪𝘯𝘨 𝘚𝘍𝘋𝘟: 𝘈𝘶𝘵𝘩𝘰𝘳𝘪𝘻𝘦 𝘢𝘯 𝘖𝘳𝘨"

     you can also refer to refer to the below links which might help you further with the above issue.https://salesforce.stackexchange.com/questions/208158/authorizing-dev-hub-from-force-com-ide2-redirects-to-localhost-after-authorizinghttps://salesforce.stackexchange.com/questions/249857/cannot-connect-a-salesforce-org-using-authorize-an-org-in-vs-codehttps://salesforce.stackexchange.com/questions/251589/unable-to-authorize-salesforce-org-using-sfdx-trailhead

    Hope it helps :), please mark it s best answer

  3. Dec 6, 2023, 10:37 AM

    Hi @Puneet Garg,

     

    I'm Nagendra from Trailhead Help team. Can you please let us know if this is a part of any Trailhead module/project? If so please share the link to the Trailhead badge so that we can check and assist further.

     

    Looking forward to your response :)

     

    Best Regards, 

    Nagendra

  4. Divya Chauhan (Kcloud Technologies) Forum Ambassador
    Dec 4, 2023, 9:48 AM
  5. Dec 2, 2023, 9:54 PM

    I tried without VPN too but still same issue. 

  6. Dec 1, 2023, 5:54 PM

    Hi @Puneet Garg,

     

    Please follow the below stack exchange and forum link. There we can see it is related to a connection issue.

     

    https://salesforce.stackexchange.com/questions/384868/invalid-credentials-error-authenticating-with-auth-code-reason-unable-to-get 

     

    It just resolved by deactivating the company's VPN then re-authorizing via VSCode 

    Related links:-

    https://trailhead.salesforce.com/pt-BR/trailblazer-community/feed/0D54S00000PeM4LSAV  

    https://developer.salesforce.com/forums/?id=9062I000000DKBwQAO&_ga=2.160888756.865049607.1701005672-363844016.1698957572 

     

    I hope this will help.

     

    Thank you

0/9000