Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to login to Windows using PIN code programmatically

In Windows 8 a new authentication method for non-domain users has been introduced: using PIN set in Control Panel.

Currently our application supports Windows logon by pre-saved password using LogonUserW() and now requires support of PIN as well.

How can we achieve that from .NET application, directly or by P/Invoke?

like image 921
abatishchev Avatar asked Oct 21 '22 18:10

abatishchev


1 Answers

So all that stuff is governed by the ICredentialProvider hive of interfaces - for Windows 8, they added an extension in ICredentialProvider2, mainly to tie credential providers to individual user accounts.

I'm no expert here, but I did dig up some references:

  • http://msdn.microsoft.com/en-us/magazine/cc163489.aspx
  • http://msdn.microsoft.com/en-us/library/windows/desktop/bb776042(v=vs.85).aspx
  • http://msdn.microsoft.com/en-us/library/windows/desktop/bb776029(v=vs.85).aspx
  • http://msdn.microsoft.com/en-us/library/windows/desktop/hh706912(v=vs.85).aspx

My gut says you could probably create a slim wrapper for the COM interfaces (probably the ICredentialProviderProvider and ICredentialProvider interfaces), and invoke them that way...but I'm mostly guessing here.

like image 182
JerKimball Avatar answered Oct 27 '22 09:10

JerKimball