Windows7 credential provider to automatically logon user on the hardware event
Asked Answered
M

2

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?

Momentous answered 23/12, 2011 at 18:13 Comment(0)
P
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.

Presbyterian answered 10/3, 2012 at 17:3 Comment(5)
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.Momentous
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!Debose
@Momentous 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.Patrica
@Sean Sorry, I haven't touched that project for more than a year. And all the code for it is under NDA.Momentous
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.Keating
G
1

After you fill credentials data, call ICredentialProviderEvents::CredentialsChanged

Gusman answered 12/4, 2015 at 20:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.