question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Error authenticating with the refresh token due to: invalid client credentials" when running "sfdx force:user:create"

See original GitHub issue

Summary

While running sfdx force:user:create I’m getting an error: ERROR running force:user:create: Error authenticating with the refresh token due to: invalid client credentials The user is created though.

Steps To Reproduce:

On any Scratch Org (I tested with the Dreamhouse-lwc repo, I could repro), try tro create a user like this: sfdx force:user:create -f user.json

I’m using a basic user file:

{
    "Username": "richard@piedpiper.com.1234",
    "FirstName": "Richard",
    "LastName": "Hendricks",
    "profileName": "Standard Platform User"
}

Expected result

The user is created without any error.

Actual result

The user is created, but the command fails with an error.

Additional information

macOS BigSur

@oclif/plugin-autocomplete 0.3.0
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-help 3.2.1 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-update 1.3.10 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-scanner 2.5.1
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
analytics 1.12.1 (core)
auth 1.4.6 (core)
config 1.2.3 (core)
evergreen 0.34.0
└─ evergreen-build 0.20.2
generator 1.1.3 (core)
salesforcedx 50.13.3 (core)
├─ schema 1.0.3 (core)
├─ limits 1.0.2 (core)
├─ user 1.0.5 (core)
├─ templates 50.4.0 (core)
├─ apex 0.1.4 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
├─ salesforce-alm 50.13.1 (core)
└─ custom-metadata 1.0.11 (core)
sfdx-cli 7.84.2 (core)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
FabienTailloncommented, Jan 29, 2021

Looks like the commands crashing is in sfdx core: https://github.com/forcedotcom/sfdx-core/blob/main/src/user.ts#L349

0reactions
FabienTailloncommented, Feb 16, 2021

I’m closing this one as I got it fixed, even though I don’t know why the connected app changed. I’ll let it up to you to see if this could be the root cause of other open issues. Thanks @WillieRuemmele for the help 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error authenticating with the refresh token due to: expired ...
It happened to me every time we refresh our dev org, so you can try to logout your user with the command: sfdx...
Read more >
invalid client id when attempting OAuth Authentication with ...
I created a new Connected Appin the Salesforce Setup App Manager. I clicked enable OAuth settings and selected Full Access as the Oauth...
Read more >
Error authenticating the refresh token due to
While working on Salesforce project using VS Code you/user might notice that the VS Code's refresh command suddenly stopped working.
Read more >
Requesting access tokens and authorization codes
This section explains how to request an access token using the authorization code grant type flow. For an introduction to OAuth 2.0 grant...
Read more >
SFDX - Error authenticating with auth code due to: grant type ...
ERROR running auth:web:login: Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: grant type not ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found