You need to sign in to do that
Don't have an account?

VS Code Authorizing an Org: authentication failure
Hello!
I created a new project with manifest in VS Code, but I am not able to authorize an Org(sandbox) to it. When I run:
sfdx force:auth:web:login --setalias <alias> --instanceurl <sanboxURL> --setdefaultusername
, it opens the authentication screen, then I insert login + password and it redirects me to localhost:1717 with the following error:
Error authenticating with auth code due to: authentication failure
This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.
,in vsc it shows me the following error:
ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: authentication failure
VS Code Version: 1.56.2
SFDX CLI Version: sfdx-cli/7.102.0 win32-x64 node-v16.1.0
Salesforce Extension Pack: 51.14.0
I created a new project with manifest in VS Code, but I am not able to authorize an Org(sandbox) to it. When I run:
sfdx force:auth:web:login --setalias <alias> --instanceurl <sanboxURL> --setdefaultusername
, it opens the authentication screen, then I insert login + password and it redirects me to localhost:1717 with the following error:
Error authenticating with auth code due to: authentication failure
This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.
,in vsc it shows me the following error:
ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: authentication failure
VS Code Version: 1.56.2
SFDX CLI Version: sfdx-cli/7.102.0 win32-x64 node-v16.1.0
Salesforce Extension Pack: 51.14.0
All Answers
Check out with below thread if it helps you resolve the issue you are facing:
https://developer.salesforce.com/forums/?id=9060G000000MVBsQAO
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.
Hi Miguel,
Check this Solution from @Vishesh Maskey (https://developer.salesforce.com/forums/?id=9062I000000IDtcQAG)
Try this way too. Open your project and Try using the command pallette . Press (Ctrl + Shif + P) or Go to View > Command Pallette.
Type 'Authorize an org' > Select Sandbox > Type an Alias or any name > then you will taken to authorize in a browser. Login and you should be good to go. Try logging in sandbox in the same browser prior of doing all these steps which will make it easy.
Hope you find your solution quickly. Do Mark this suggestion as Best Answer if it helps.
Thank you
I had already tried the solution of that post, in the first step sfdx force:auth:web:login it already returns the error:
ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: retry your request
I have nothing running on port 1717
Can you post the exact CLI command which you are trying to run in this thread to check?
Its been also found that the problem could be using lightning.force.com domain instead of my.salesforce.com.
Thanks.
sfdx force:auth:web:login --setalias devOrg --instanceurl https://geamanagement--dev2.my.salesforce.com/ --setdefaultusername
What is mean by connection error? I am receiving same error, although i never received such error, and therefore wanted to know what made you fix this?
What was giving me an error:
sfdx auth:web:login --setalias mysfdxorgalias
What allowed me to log in:
sfdx auth:web:login --setalias mysfdxorgalias --instanceurl https://my-instance-url
I believe that the reason it failed originally was because my logins were defaulted to production, which is a little like trying to log into a sandbox with login.salesforce.com. It just wouldn't work. So when I attempted the sfdx login and then change my domain to the proper instance URL and then give the proper sandbox credentials, I encountered the failure listed in the original post.
None of the above information worked for me!
I solved it as follows by putting YES!
https://NAMEORG--hotfix.sandbox.my.salesforce.com/
Thanks !
Here's what I did
1. Login to salesforce org
2. Switch view to salesforce classic from "view profile" option at the top right corner
3. Log out (click on user name)
4. Copy the url from logged out page
5. Use this url in the Custom option while Authorizing an org
Example: https://<domain-name>.my.salesforce.com