5

I am setting up SF-DX using trial Dev Hub enabled Org and completed below steps:

  1. Set up Force.com IDE2 and Salesforce CLI.
  2. Added SFDX project.

But when i am trying to Authorize my Dev Hub, it authorizes SF org credentials and then redirects to http://localhost:1717/OauthRedirect?code=xxxx&state=xxx

I googled and found that we need to add connected app so i have also:

  1. Added connected app with callback URL http://localhost:1717/

I am not able to understand how this URL will be resolved as, what do I need to to resolve this URL or am I missing on some set up steps.

I am using Windows 7.

Thanks

5
  • You shouldn't need to add a Connected App to your Dev Hub unless you are planning to use the JWT flow in continuous integration. How are you authorizing your hub? Are you on a locked-down corporate network?
    – David Reed
    Feb 14, 2018 at 14:32
  • ok. i will remove it but how do i fix localhost:1717/OauthRedirect?code=xxxx&state=xxx redirect issue Feb 14, 2018 at 14:35
  • >How are you authorizing your hub? Are you on a locked-down corporate network? Please edit your question to add details.
    – David Reed
    Feb 14, 2018 at 14:36
  • Yes..but would prevent it from authorizing Feb 14, 2018 at 14:38
  • Use : salesforce.stackexchange.com/a/251988/87456 Jan 13, 2021 at 15:35

3 Answers 3

2

You don't "need" the Connected App ordinarily, as it usually uses the Global Connected App that Salesforce uses by default. If you're having problems, all the usual software needs to be checked. Your firewall should allow access to localhost:1717, your computer should have a free port at 1717 (meaning, only one copy of the command line should be running at once), you should update your command line to the latest version via sfdx update, or as a final resort, try reinstalling the command line. You might also need the assistance of IT if your firewall, antivirus, or some other configuration is blocking access to localhost.

2
  • my localhost is up with port with IIS.. my question is how this URL will be resolved i need technical explanation on this.. how my system will recognized this location .. by location i don't only mean localhost but also localhost/OauthRedirect?code=xxxx&state=xxx.. is this handled in salesforce cli Feb 15, 2018 at 14:02
  • 2
    @sfdeveloper Yes, the CLI sets up an HTTP server on port 1717 (by default, but you can change this), and waits for the callback from the OAuth login.
    – sfdcfox
    Feb 15, 2018 at 15:22
1

Try changing the port in your address bar to from 1717 to 7717. I can't speak to why this happens but it is the solution I have found works.

1
  • 1
    WOW ... thank you so much for sharing this! This has been driving me INSANE. I'm still not sure where this issue came from but for me it started in early 2022 and has happened both with actual SFDC sandboxes instances as well as Playground/Dev instances. FWIW none of the other suggestions helped me. I tried updating VS Code extensions, using MS Edge, fussing with oauthLocalPort in sfdx-project.json, disabling AV and/or Firewall - none of these made a difference. My setup for reference: Win 10 x64, VS Code 1.64.2, Node 14.16.0, SFDX 7.137.1 Feb 14 at 15:15
0

I was facing the same issue, but then I tried below and got solved.

  1. Go to -> sfdx-project.json file in your vs code
  2. Add "oauthLocalPort" : 1717

This worked for me just now.

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.