1

I am evaluating a 3rd party API WebDAV.NET for gaining access to SharePoint web folders. This API accepts the standard .Net network credentials and gives me two options:

ICredentials credential = CredentialCache.DefaultCredentials;

and

NetworkCredential credential = new NetworkCredential("[user]", "[password]");

If I connect to a network location (web folder) through Windows Explorer and authentication is required, Windows will automatically prompt me for a user name and password. I can then choose to remember the credentials and Windows will store them. Having done this, I can then use the first method above CredentialCache.DefaultCredentials to connect to the SharePoint web folder using this 3rd party API.

If however, I have not connected via Windows Explorer first, I could use the second option and provide a user name and password. However, these credentials do not get saved and do not get remembered.

I do not want to create my own mechanism for securing and storing these credentials. What I would like to do is prompt the user for his user name and password, create a network credential and store this to the Windows vault such that I can then turn around and use the first method CredentialCache.DefaultCredentials in connecting to the SharePoint web folder.

I basically would like to accomplish what Windows Explorer does, prompt for user name and password and then remember these.

Elan
  • 6,084
  • 12
  • 64
  • 84
  • There's no such thing as a "Windows Vault". You're thinking of how the Mac does things. – Erik Funkenbusch Mar 21 '12 at 19:54
  • Follow the instructions in the following article on Windows 7 and you will see a window which says "Windows vault": http://www.faqforge.com/windows/how-delete-saved-passwords-for-network-drives-in-windows/ – Elan Mar 21 '12 at 20:01
  • 1
    you should look at a similar http://stackoverflow.com/questions/2394721/storing-credentials-in-credential-manager-service – Kharaone Mar 21 '12 at 20:17
  • @Elan - Wow, did not even know that was there. Still, it's a Windows 7 only feature, and I wouldn't trust it to stick around. – Erik Funkenbusch Mar 21 '12 at 21:39

0 Answers0