locked
Password Vault Failure

    Question

  • I have a Javascript App in the Windows Store. From the feedback I got in the Store, my app has some problem with authentication. I narrowed it down and found out that the problem could result from a PasswordVault failure when trying to write to the vault. 

    Here is my code and I wonder what kind of exception could be thrown by PasswordVault API and why it happens?

    function setValueInVault(key, value) {
            try {
                var vault = new Windows.Security.Credentials.PasswordVault();
                var cred = new Windows.Security.Credentials.PasswordCredential(
                    PASSWORD_VAULT_RESOURCE_NAME, key, value);
                vault.add(cred);
            }
            catch (e) {
                
            }
        }

    Thanks.


    Louis

    Saturday, January 05, 2013 10:57 PM

Answers

  • Hi Louis,

    The code you provide looks quite simple and clear which is exactly how the sdk sample demonstrates (about how to store credentials via PasswordVault). And the MSDN reference also haven't explicitly document any definite exceptions that might be thrown. Have you checked if the parameters (like the key and value you supply to the PasswordCredential constructor) could contain invalid values (caused by some potential errors in other places)? It would be helpful if we can get some definite repro steps so as to perform some local debugging on dev environment.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Friday, January 11, 2013 9:38 AM
    Tuesday, January 08, 2013 6:57 AM
    Moderator