Skip to content

a-ctor/WindowsCredentialManager

Repository files navigation

WindowsCredentialManager

A .NET Standard 2.0 library that provides basic access to the Windows Credential Manager. Supported operations:

  • Reading/Writing generic credentials
  • Show a prompt for generic credentials

Examples

Writing generic credentials:

var credentials = new GenericCredentials ("UNIQUE_TARGET_ID");
genericCredentials.UserName = "admin";
genericCredentials.Password = password;

genericCredentials.Save();

Reading generic credentials:

var genericCredentials = new GenericCredentials ("UNIQUE_TARGET_ID");
genericCredentials.Load();

Prompting the user for credentials:

var promptResult = CredentialsPrompt.Show (
    "Please enter your password", 
    "Password required!");

if (!promptResult.Cancelled)
{
  var username = promptResult.Username;
  var password = promptResult.Password;   
}

About

A .NET Standard 2.0 library providing programmatic access to the Windows Credential Manager.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages