locked
Password from Credential Picker

    Question

  • I am using Credential Picker in my Application for user authentication. But the password that Credential Picker is passing is hashed(by default Negotiate authentication protocol), and while debugging I found that for the same password it is generating different hashes. So How will I perform username and password matching with my DB data?

    What is the best and proper solution to do password matching with the DB stored password in this case?

    below is code snippet:

    function launchCredentialPicker() {
    
            Windows.Security.Credentials.UI.CredentialPicker.pickAsync("My Target", "My Message", "my Caption").then(function (results) {
    
                var domainName = results.credentialDomainName;
                WinJS.Application.sessionState.Username = results.credentialUserName;
                WinJS.Application.sessionState.Password = results.credentialPassword;
                WinJS.Application.sessionState.RememberPassword = (results.credentialSaveOption === Windows.Security.Credentials.UI.CredentialSaveOption.hidden) ? "Hidden" :
                                       ((results.credentialSaveOption === Windows.Security.Credentials.UI.CredentialSaveOption.selected) ? "Selected" : "Unselected");
               
            });
        }

    Thursday, September 5, 2013 10:21 PM

Answers

All replies

  • I am using Credential Picker in my Application for user authentication. authentication details in my DB are in string format. But the password that Credential Picker is passing is in encrypted form(by default Negotiate authentication protocol), So How to decry-pt that password so that i can match with my DB password.

    What is the best and proper solution to do password matching with the DB stored password?

    below is code snippet:

    function launchCredentialPicker() {
    
            Windows.Security.Credentials.UI.CredentialPicker.pickAsync("My Target", "My Message", "my Caption").then(function (results) {
    
                var domainName = results.credentialDomainName;
                WinJS.Application.sessionState.Username = results.credentialUserName;
                WinJS.Application.sessionState.Password = results.credentialPassword;
                WinJS.Application.sessionState.RememberPassword = (results.credentialSaveOption === Windows.Security.Credentials.UI.CredentialSaveOption.hidden) ? "Hidden" :
                                       ((results.credentialSaveOption === Windows.Security.Credentials.UI.CredentialSaveOption.selected) ? "Selected" : "Unselected");
               
            });
        }


    Thursday, September 5, 2013 3:29 PM
  • Hi,anandvardhandas

    I suggest you can set the CredentialPickerOptions.AuthenticationProtocol to Basic,when

    you use PickAsync(CredentialPickerOptions) method to get the credentials,the password

    you get is not hashed.

    As far sa i know,you can not decrypt the credentials when the AuthenticationProtocol equals to

    the default value Negotiate.

    You can refer to these links below to get more information:

    http://msdn.microsoft.com/en-US/library/windows/apps/windows.security.credentials.ui.credentialpickeroptions.authenticationprotocol.aspx

    http://code.msdn.microsoft.com/windowsapps/Credential-picker-sample-4d640c23

    Best Wishes!


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Friday, September 6, 2013 2:49 PM