6

I am developing a custom credential provider for Windows 7. My goal is to automatically log-in the user when a certain hardware event occurs. I have read all the MSDN articles related to this, and implemented a simple credential provider that interfaces with the external device to get user name and password and passes it to the WinLogon.

But, I still am stuck with the last piece of the puzzle. Currently the user still has to press the logon button to log himself in. What is the best way to do that automatically?

ixe013
  • 9,559
  • 3
  • 46
  • 77
Vlad
  • 9,180
  • 5
  • 48
  • 67

2 Answers2

9

Currently I'm working on the same and I think that

a) in function Provider::GetCredentialCount, you set a pdwDefault and set pbAutoLogonWithDefault to true
or
b) in Credential::SetSelected you set pbAutoLogon to true.

With a) the user has no choice and with b) he has to choose the account first.

  • Right, this is exactly what I ended up doing. This question was posted few months ago. I was just too lazy to write up the answer hre. – Vlad Mar 11 '12 at 10:20
  • I'm struggling with the samples. I want to trigger the logon or unlock using an external event, but am not sure how to make that happen. I understand setting pbAutoLogonWithDefault to true in Provider::GetCredentialCount, but how do I get LogonUI to call Provider::GetCredentialCount? Also, are the serialized credentials provided by LogonUI or do I have to use stored usernames and passwords. Any help would be great, thank you! – piusvelte Oct 29 '12 at 20:36
  • @Vlad do either of you have sample code for this you can provide? I am working on something similar and I can't interface with my hardware device. – Sean Dunford Jul 02 '13 at 20:28
  • 1
    @Sean Sorry, I haven't touched that project for more than a year. And all the code for it is under NDA. – Vlad Jul 03 '13 at 10:54
  • 1
    Have a thread that will monitor for the hardware event. Once the event occurs, Calling ICredentialProviderEvents::CredentialsChanged with the AdviseContext should re-enumerate the credentials where the autologon can be set to true. – Wander3r Dec 12 '16 at 10:30
1

After you fill credentials data, call ICredentialProviderEvents::CredentialsChanged

Alex
  • 11
  • 2