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:

  1. Create a passwordVault object.
  2. 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.
  3. 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 
    } 

How to save user credentials

How to enumerate and retrieve user credentials

Credential locker sample

 

 

Build date: 6/11/2013