Я бы предложил использовать Windows.Security.Credentials:
PasswordVault vault = new PasswordVault();
PasswordCredential credential = null;
try
{
credential = vault.FindAllByResource("SomeName").FirstOrDefault();
}
catch
{
}
if (credential!=null)
{
string username = credential.UserName;
credential.RetrievePassword();
string password = credential.Password;
}
else
{
try
{
//login
credential = new PasswordCredential("SomeName",username,password);
vault.Add(credential);
}
catch
{
}
}
U может использовать свойство пароля в качестве пароля или токена.