title: Windows credentials prompt in custom WPF dialog
body: <p><em><strong>Q.</strong> How can I reuse in WPF the security features provided by the <a href="http://www.developerfusion.com/code/4693/using-the-credential-management-api/" rel="nofollow noreferrer">Windows credentials dialog</a> (WinForms32)?</em></p>
  
  <p><strong>Brainstorm (not sure if any of these are possible):</strong></p>
  
  <ol>
  <li><p>Host the WinForms32 dialog inside my own WPF dialog. MSDN has an <a href="http://msdn.microsoft.com/en-us/library/ms751761.aspx" rel="nofollow noreferrer">article</a> that explains how to host a WinForms <strong>control</strong> (i.e., textbox, etc.) but not a WinForms dialog. Yes, this will be ugly, but we're not worried about looks right now.</p></li>
  <li><p>Provide a WPF GUI that wraps the WinForms dialog. Upon login, the WPF username textbox and WPF <a href="https://stackoverflow.com/questions/2978348/wpf-password-box-into-a-securestring-in-c-sharp"><code>SecurePassword</code></a> textbox are transferred to their WinForms equivalent under the covers. The moving of sensitive data might pose a security risk (but some may argue that the attacker has plenty of other ways to steal your password).</p></li>
  <li><p>Move the WinForms username and password textboxes to the WPF dialog ("re-parent" the existing textboxes).</p></li>
  </ol>
  
  <p>Any suggestions/comments (including criticism of my ideas) are appreciated!</p>