How to delete user credentials (Windows Store apps using JavaScript and HTML)
This topic shows how to delete credentials from a credential store.
Technologies
Instructions
Step 1:
- Create a passwordVault object.
- Retrieve the credential or set of credentials you want to remove from the store. For information about how to do this, see How to enumerate and retrieve user credentials.
- Call the passwordVault.remove method.
Step 2: Deleting credentials from the store.
The following snippet from the Credential locker sample shows how to remove all credentials from the store.
try {
var creds = vault.retrieveAll();
for (var i = 0; i < creds.size; i++) {
try {
vault.remove(creds.getAt(i));
}
catch (e) { // Remove is best effort
}
}
}
catch (e) { // No credentials to remove
}
Related topics
How to enumerate and retrieve user credentials
Build date: 6/11/2013