Password in Windows credentials is not updated on next `set_password` call

Open
#545 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with the Windows.WinVaultKeyring backend listed by keyring --list-backends, then reproduce the two keyring set_password calls on Windows and inspect the resulting Credential Manager entries. Compare the CLI path with the direct Python keyring.set_password path; done means the second call updates the existing credential rather than creating a second entry.

Written by the indexing model from the issue text.

Description

bug help wanted Windows

Describe the bug
New entry is created instead of updating existing password.

To Reproduce

  1. Open cmd.exe and set password with CLI utility

    C:\>keyring set service username
    Password for 'username' in 'service': <enter the password>
    
  2. Open Credential manager and observe a new entry:
    image

  3. Update password. Open cmd.exe again and set new password with CLI utility for the same service and user name

    C:\>keyring set service username
    Password for 'username' in 'service': <enter another password>
    
  4. Refresh Credential manager's window and see two entries: service and username@service

    image

Expected behavior
Second call for keyring set service username should modify existing entry instead of creating new one.

Environment

  • OS: Windows 10 Pro with all recent updates.
C:\> pip list | grep keyring
keyring                    23.2.1

C:\> keyring --list-backends
keyring.backends.Windows.WinVaultKeyring (priority: 5)
keyring.backends.chainer.ChainerBackend (priority: -1)
keyring.backends.fail.Keyring (priority: 0)

Additional context
The same behavior is observed in call to keyring.set_password in python scripts.

Dominant language
Python
Stars
1.5k
Forks
208
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jaraco/keyring

All issues in jaraco/keyring

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.