+ Start a Discussion
Randall ToepferRandall Toepfer 

Visual Studio OAuth

I'm getting an error on sfdx cli authorize an org.  I'm experiencing the error on two different Salesforce orgs on two, accessed by two different laptops (my corporate laptop and personal laptop used for freelancing), and on two different networks (my corporate VPN and home network).

The error is:

We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator.
OAUTH_APPROVAL_ERROR_GENERIC : An unexpected error has occured during authentication. Please try again.

I've tried setting "relaxing ip restrictions" on the Salesforce CLI app, and tried running the sfdx authorize command with the scope in the url:

sfdx force:auth:web:login -r https://login.salesforce.com/services/oauth2/authorize?prompt=login&scope=full

Nothing is working and the OAuth hangs until I hit refresh and then get the above error.  I've tried in Firefox and Chrome browsers and after deleting cache.

Anyone know of a solution?  Thanks
SwethaSwetha (Salesforce Developers) 
Hi Randall,
Was this working earlier? Has there been any update to SFDX recently?

Can you try sfdx auth:web:login instead of sfdx force:auth:web:login 

Randall ToepferRandall Toepfer
Its an issue with the Salesforce CLI that has been reported on Github.

Malika Pathak 9Malika Pathak 9
Hi Randall,

I also faced the same issue after I update CLI but I rollback to the old version and now it is working fine.
you should also rollback to the old version of CLI.