Using the Windows.Security.Credentials.PasswordVault
class, I can access the passwords stored under "Web Credentials" in the Windows Credential Manager:
using System;
using Windows.Security.Credentials;
class Program {
static void Main(string[] args) {
PasswordVault vault = new PasswordVault();
foreach (var cred in vault.RetrieveAll()) {
cred.RetrievePassword();
Console.WriteLine("Resource: {0}", cred.Resource);
Console.WriteLine("UserName: {0}", cred.UserName);
Console.WriteLine("Password: {0}", cred.Password);
}
}
}
I would like to know if there's a way to retrieve the credentials stored under "Windows Credentials" instead.
The Windows Credential Manager is a hidden desktop app that stores account information, including the passwords you enter when you're using Microsoft Edge or Internet Explorer. The tool also saves credential information you won't be able to view, like authentication tokens created by apps and network services.
Application and network credentials are stored in the Windows Credentials locker. Credential Lockers store credentials in encrypted . vcrd files, located under %Systemdrive%\Users\\[Username]\AppData\Local\Microsoft\\[Vault/Credentials]\ .
There is a Nuget library called CredentialManagement http://nuget.org/packages/CredentialManagement/ from the answer here: Retrieve Credentials from Windows Credentials Store using C#
works perfectly
var cm = new Credential();
cm.Target = "mycredentialname";
if (!cm.Exists())
{
Console.WriteLine("cm is null");
}
cm.Load();
Console.WriteLine("Password: " + cm.Password);
Console.WriteLine("Username: " + cm.Username);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With