# Accessing windows credentials (or chrome credentials)

**URL:** https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381
**Category:** General Usage
**Created:** [August 10, 2019, 9:02am UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381 "2019-08-10T09:02:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [August 10, 2019, 9:02am UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381/1 "2019-08-10T09:02:28Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [August 10, 2019, 10:21am UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381/2 "2019-08-10T10:21:18Z")

</div>

Good question! In Python on Linux you can use the pwd module - the Password Database module  
[https://docs.python.org/2/library/pwd.html](https://docs.python.org/2/library/pwd.html)

A quick search finds this relevant discussion:  
[https://stackoverflow.com/questions/3305787/what-is-the-windows-equivalent-of-pwd-getpwnamusername-pw-dir](https://stackoverflow.com/questions/3305787/what-is-the-windows-equivalent-of-pwd-getpwnamusername-pw-dir)

[http://timgolden.me.uk/pywin32-docs/win32security.html](http://timgolden.me.uk/pywin32-docs/win32security.html)

Errrr… yep I am talking about Python not Julia

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [August 11, 2019, 8:32pm UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381/3 "2019-08-11T20:32:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [August 12, 2019, 5:23am UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381/4 "2019-08-12T05:23:30Z")

</div>

For this purpose I would suggest looking at Vault

> **[Vault by HashiCorp](https://www.vaultproject.io/)**
>
> Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets critical in modern computing.

There is a CLI and an HTTP API [HTTP API | Vault | HashiCorp Developer](https://www.vaultproject.io/api/)
