Authorize Org failed in VS Code

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 " : "

Hope it helps :)


Solution straight from the Salesforce DX Developer guide. This worked right away for me on MacOs

https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_troubleshoot_cancel_auth.htm


As the error says, port 1717 is not free. Try restarting your computer to see if the error persists. If so, you'll need to use a custom connected app, as outlined in Create a Connected App.