function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SK_SFSK_SF 

SFDX: authorize a Dev Hub is failing with below error.

Trying to authorize a dev hub using sandbox username and password.
and getting below error :

sfdx force:auth:web:login --setdefaultdevhubusername
ERROR running auth:web:login:  Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: authentication failure
18:58:20.917 sfdx force:auth:web:login --setdefaultdevhubusername
 ended with exit code 1


Can anyone please help on this?

 
Best Answer chosen by SK_SF
SK_SFSK_SF
Got the issue :

I was trying to authorize dev hub using sandbox due to that this above error was comming in my case. And we must need to use the credentials of org on which you have enabled the Dev Hub. I used my prod credential to authorize dev and that worked for me.

All Answers

SwethaSwetha (Salesforce Developers) 
HI SK,
Was this working earlier?
SK_SFSK_SF
Trying first time.
SK_SFSK_SF
Hello Swetha,

I am trying first time, Any idea on that error?
 
SwethaSwetha (Salesforce Developers) 
Can you try below SFDX command and see if it works
 
sfdx auth:web:login --setalias mysfdxorgalias --instanceurl https://mysandbox-org.sandbox.my.salesforce.com/

Incase this doesn't fix, I'd recommend trying the other approaches that worked for users on this thread

If this information helps, please mark the answer as best. Thank you
 
SK_SFSK_SF
Got the issue :

I was trying to authorize dev hub using sandbox due to that this above error was comming in my case. And we must need to use the credentials of org on which you have enabled the Dev Hub. I used my prod credential to authorize dev and that worked for me.
This was selected as the best answer