r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

Add native access to Windows Credential Manager #86

Closed MichaelJW closed 3 years ago

MichaelJW commented 4 years ago

Relates to this issue: https://github.com/r-lib/keyring/issues/84

gaborcsardi commented 4 years ago

Thanks! Looks great! One quick question before the details. Does Windows actually store the username? The docs say

If the credential Type is CRED_TYPE_GENERIC, this member can be non-NULL, but the credential manager ignores the member.

MichaelJW commented 4 years ago

I hadn't noticed that line in the docs. You're right, it suggests that Windows shouldn't be storing the username. However, my tests (on Windows 10, FWIW) show that it does:

image

Strange...

gaborcsardi commented 4 years ago

OK, I checked on Vista, which is the oldest versions that current R supports, and that has a username field as well, so we should keep it.

MichaelJW commented 4 years ago

Hey @gaborcsardi, anything required from me here? I have more time on my plate from this week on now that lockdown's eased a bit and schools are back on :smile:

gaborcsardi commented 4 years ago

Thanks much, it looks awesome! I decided to create a lean lower level keyring package, that implements the non-portable APIs as well, and I'll use this code there: https://github.com/gaborcsardi/oskeyring (Only the macOS code is new there, Windows is next.)

Eventually this package will just call that.

MichaelJW commented 4 years ago

Sounds great, thanks - I'll keep an eye on that package!

gaborcsardi commented 3 years ago

Thanks again! I will not merge this here, because the oskeyring package has this functionality now. Hopefully you can use that for your use case. Please open an issue otherwise.