2

I have installed VS code, Salesforce CLI with extensions, and Java.

I have created the project. After that, I tried to authorize an org in vs code. But I faced the issue as

Starting SFDX: Authorize an Org

20:41:47.938 sfdx org:login:web --alias Trialhead --instance-url https://login.salesforce.com --set-default Error (1): Invalid request method: OPTIONS

20:42:12.795 sfdx org:login:web --alias Trialhead --instance-url https://login.salesforce.com --set-default ended with exit code 1

I tried to find the solution for so many hours. I couldn't find anything. I came across the CORS and HTTP OPTIONS request. But I don't know what to do to resolve this blocker.

Kindly someone help me with this.

SF CLI Version -- C:\Users\manoj>sf --version@salesforce/cli/2.30.8 win32-x64 node-v20.11.1

I have done following things in VS Code while trying to solve this issue.

Salesforcedx-vscode-apex › Java: Home = C:\Program Files\Zulu\zulu-17

Salesforcedx-vscode-core: NODE_EXTRA_CA_CERTS = C:\Program Files\sf\bin\sfdx

4
  • 1
    What if you try the same command directly in terminal, with --debug at the end ? Commented Mar 9 at 13:55
  • I tried what you suggested, but I got the same issue. Is it my side or what do I need to do? This is a big blocker for me.
    – Madhavan p
    Commented Mar 9 at 18:18
  • It's probably on your side :/ Are you behind a proxy, or do you have an angry firewall that would block JWT listener ? Commented Mar 10 at 21:51
  • I have same for sandboxes
    – kurunve
    Commented Mar 22 at 12:50

3 Answers 3

2

try this command :

sfdx auth:device:login -a dev-sandboxname -r https://test.salesforce.com -s

And then enter the code given in the CLI 😉

0

What worked for me was logging into the org on the browser, then running sfdx force:auth:device:login. It will provide you with a code and a verification URL. After pasting the code, you'll be able to select the org and deploy to it etc

0

I get the same error when trying to login from different browser than one opened by sfdx.

I normally default to Safari, but use Brave for work. When login prompt appears I would just paste login url to Brave and it worked until few days ago.

Edit looks like Chrome is to blame here: https://github.com/forcedotcom/cli/issues/2785

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .