node-keytar icon indicating copy to clipboard operation
node-keytar copied to clipboard

[Windows] Old credential comes back after current one is deleted

Open xsq007 opened this issue 3 years ago • 3 comments

Prerequisites

Description

A value was set for some service/account for keytar 4.x. Then migrate keytar to 7.x and set another value for same service/account. Delete this service/account and the old value set in keytar-4.x came back after rebooting the computer.

Steps to Reproduce

  1. npm i keytar@^4
  2. keytar.setPassword('service', 'account', '1')
  3. npm i keytar@^7
  4. keytar.setPassword('service', 'account', '2')
  5. keytar.deletePassword('service', 'account')
  6. reboot computer
  7. Check Windows Credential Manager and service/account credential still exists and its value is 1.

Expected behavior: There should be no service/account credential in Windows Credential Manager after calling deletePassword.

Actual behavior: The old one set in keytar-4.x came back.

Reproduces how often: Every time

Versions

Additional Information

xsq007 avatar Mar 30 '22 12:03 xsq007

Windows version?

Nantris avatar Apr 20 '22 21:04 Nantris

Just an FYI

Mailspring uses keytar and there are various reports of issues with passwords, i.e. being old or reset to a previous one. https://community.getmailspring.com/search?q=password%20%23bugs

Most seem to be related to Windows OS

glenn2223 avatar Dec 12 '22 11:12 glenn2223

If anyone is using key-tar in Electron; Electron has its own similar mechanism now. I forget the name though.

Nantris avatar Dec 12 '22 18:12 Nantris