title: How do I store or associate additional data with a PasswordCredential?
body: <p>My UWP application logs into several web services using several accounts. Each one contains an URL, password and username along with additional information such as a developer key, etc. I would like to securely store them as roaming settings assigned to a Windows user account.</p>
  
  <p>UWP's Credential Locker appears to securely store the credentials part, the user name and password.  It also roams with the user and I can live with its 10 credential storage limitation (<a href="https://docs.microsoft.com/en-us/uwp/api/windows.security.credentials.passwordvault" rel="nofollow noreferrer">Credential Locker</a>)  Unfortunately, there doesn't seem to be a clear way of including or associating it with my accounts using a unique ID:</p>
  
  <pre><code>//
  //Add a credential to PasswordVault by supplying resource, username, and password
  //
  Windows.Security.Credentials.PasswordVault vault = new Windows.Security.Credentials.PasswordVault();
  PasswordCredential cred = new PasswordCredential(InputResourceValue.Text, InputUserNameValue.Text, InputPasswordValue.Password);
  vault.Add(cred);
  </code></pre>
  
  <p>PasswordVault requires a username, resource string and password.  Although I can retrieve a credential using a username, its not guaranteed to be unique.  Although the resource key is unique, it's not clear whether it identifies the actual credential or its container.</p>
  
  <p>Any ideas on how to resolve this? </p>