Couple of days ago, when logging in to the Org via browser, I was prompted to update my password. Last time I used Salesforce CLI was 2 weeks ago and today I had to do it again. However, no password update was needed and I could perform all the tasks using sfdx force:mdapi:retrieve without any authentication.

How is this possible? Is it because of some kind of token save on my computer? I tried to find some info about that but without any success.


Salesforce CLI use an access token to connect to your org. This means that even if you change your password or even your username it will still be connected to your org trough your username. If you want to revoke the access permission you can do it by navigating to Setup>Home>Apps>Connected Apps>Connected Apps OAuth Usage and block the Salesforce CLI app.

  • 2
    You can even change your username without affecting the token. The alias on the local computer would be important, though. – sfdcfox Jun 4 at 14:14
  • @sfdcfox Could you explain better? If I change my username in the org an I still able to use cli without change anything in the cli configuration? – gvgramazio Jun 4 at 14:16
  • 1
    That's correct. The token itself identifies the user by ID, so even if you change the username, the CLI will continue to be connected to the scratch org. – sfdcfox Jun 4 at 14:21
  • @sfdcfox I wasn't aware of that. Thanks for sharing your knowledge. I've updated the answer accordingly. – gvgramazio Jun 4 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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