Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

"The user name or passphrase you entered is not correct." on macOS #76

Closed
dhleong opened this issue Sep 19, 2017 · 12 comments
Closed

"The user name or passphrase you entered is not correct." on macOS #76

dhleong opened this issue Sep 19, 2017 · 12 comments

Comments

@dhleong
Copy link

dhleong commented Sep 19, 2017

Interestingly, writing a password via setPassword seems to work just fine, but attempting to then read it back throws an Error with no stack, and the message:

Error: The user name or passphrase you entered is not correct.

Running macOS Sierra 10.12.6. No prompts for a password or anything appeared; it just immediately throws that error.

Using the security cli command as with the keychain or xkeychain modules seems to work just fine.

@shiftkey
Copy link
Contributor

@dhleong do you have the snippet for how you're invoking setPassword and then getPassword to trigger the failure (feel free to obscure the password field, obvs)? Maybe we're doing something with the service or account string in one code path that's not done in the other...

@dhleong
Copy link
Author

dhleong commented Sep 19, 2017

Wow, thanks for the quick response!

I'm setting as an async function, like so:

    async saveCredentials(credentials) {
        await keytar.setPassword(
            this.service, this.account,
            this._serialize(credentials)
        );
        return true;
    }

_serialize() here just JSON.stringify()s a JSON object.

Loading looks basically like:

    async loadCredentials() {
        try {
            const serialized = await keytar.getPassword(
                this.service, this.account
            );

            return this._inflate(serialized);

(The try is a fallback to node-keychain right now).

@shiftkey
Copy link
Contributor

@dhleong I think I've stumbled on the same issue over in Desktop (unable to retrieve the password where it was working fine previously) so I'm digging into that now.

@shiftkey
Copy link
Contributor

@dhleong unfortunately my error is easier to explain - a stale account in the app without anything in the keychain, so it fails as expected.

@sundaynighteffect
Copy link

@dhleong Hi, I google "The user name or passphrase you entered is not correct." and see your post. I am totally new in GitHub and not really understand what this thread is talking about 😓. I could not log in to Desktop after upgraded to macOS High Sierra, every time I try, " The user name or passphrase you entered is not correct." just popped up. Do you have any idea what should I do for this? thank you very much!

@dhleong
Copy link
Author

dhleong commented Nov 7, 2017

@fujungao This is not a general support forum for OSX, but a place to report bugs with a specific tool used in programming. You're probably better off taking your Mac to an Apple Store, or posting on the Apple Support Community.

@yassermog
Copy link

yassermog commented Nov 13, 2017

I have this problem after I upgraded to macOS High Sierra 10.13.1 (17B48)

@mazzzai
Copy link

mazzzai commented Dec 3, 2017

The same problem in HSierra. Any solutions?

@shiftkey
Copy link
Contributor

shiftkey commented Dec 3, 2017

One thing to look at is the Keychain itself - we had some reports of this in GitHub Desktop, and were somehow able to workaround it:

Try opening Keychain Access.app. Right-click on the login keychain and try locking it and then unlocking it again.

@mfardig
Copy link

mfardig commented Jan 5, 2018

Thanks @shiftkey - just lost about an hour trying to sort this out after updating to High Sierra. After locking/unlocking in Keychain, works great!!! Thank you again, you are awesome!!!

@hgoshko
Copy link

hgoshko commented Jan 10, 2018

@shiftkey hero of the day! (for me MySQLWorkbench failed to change db password after update to High Sierra)

@shiftkey
Copy link
Contributor

shiftkey commented Jul 9, 2018

I'm going to close this out as I continue to see reports of this being resolved in Keychain itself and it doesn't seem to be something we can control in keytar.

@shiftkey shiftkey closed this as completed Jul 9, 2018
dhleong added a commit to dhleong/chromagnon that referenced this issue Jun 30, 2020
Occasionally, keytar will return an error indicating that our login
credentials are wrong, even though we've entered none. In such cases,
the recommended fix is to lock and unlock the "login" keychain via
Keychain Access, but that isn't working for me right now.

See: atom/node-keytar#76

The `security` executable seems to work just fine, however....
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants