Accessing windows credentials (or chrome credentials)

Is there an easy way to “access a stored password” in a Julia script/package?
Say I have five people using the same package/script which uses individual credentials for a website (say AWS). How can I make this work smoothly?
I am using Windows 10. Can I access the windows credential manager somehow? Or the password store of chrome?
I want to avoid any user action for this if possible.

I realize that a simple way would be to store a password file on a network drive where only the given user has access. But there might be some scenarios where this should also work locally (e.g. on the move with a notebook). If users are admins, the can usually access all \users\xy\ folders.

Good question! In Python on Linux you can use the pwd module - the Password Database module

A quick search finds this relevant discussion:

Errrr… yep I am talking about Python not Julia

I suspect you won’t be able to do this without the user providing their password and/or credentials. If windows (or chrome) gave any program access to a user’s password, hackers would be laughing all the way to the bank…literally.

In chrome there might be a way to ask chrome to autofill the password…but I’ve never dealt with that.

In Julia homedir() will give you the user’s home directory so each user can have their own configuration. Although I’m loath to say “Save the password in their own file” since that is just not safe. You should encrypt it, but unless you ask the user for a password to encrypt the file with, your program will probably become the “weak link” in securing the user’s password. Even if did encrypt it with a password, your program probably hasn’t had enough people look at the code with an eye toward security, so you would still the weak link.

The most “security conscious” way will be to ask the user for their password then use it for that execution. But that might totally break what you want to achieve.

1 Like

For this purpose I would suggest looking at Vault

There is a CLI and an HTTP API

1 Like