使用 Windows 7 SDK 的凭据提供程序示例
我正在开发自定义 Windows 登录,以便用户可以使用网络摄像头(面部识别)或用户名和密码。我能够在登录屏幕上显示一个包含所有必需控制的窗口,但我不明白如何使用提供的用户名和密码进行身份验证。 Window 使用 GetSerialize() 函数来实现此目的。
GetSerialization(
__out CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE* pcpgsr,
__out CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION* pcpcs,
__deref_out_opt PWSTR* ppwszOptionalStatusText,
__in CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon
)
上面是函数签名。如您所见,系统使用 CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE*
和 CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION*
指针来获取有关用户名和密码的信息。我如何调用它进行身份验证。或者是否有其他方法可以在登录时执行此操作。
I am developing a custom windows login so that user either can user webcam (face recognition) or username and password. I am able to show a window with all required control at login screen but I don't understand how to authenticate with provided username name and password. Window uses GetSerialize() function for this purpose.
GetSerialization(
__out CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE* pcpgsr,
__out CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION* pcpcs,
__deref_out_opt PWSTR* ppwszOptionalStatusText,
__in CREDENTIAL_PROVIDER_STATUS_ICON* pcpsiOptionalStatusIcon
)
above is function signature. As you can see system uses CREDENTIAL_PROVIDER_GET_SERIALIZATION_RESPONSE*
and CREDENTIAL_PROVIDER_CREDENTIAL_SERIALIZATION*
pointer to get info about username and password. How I can call this for authentication. Or is there any alternative method for doing this at the time of login.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想知道你现在解决了吗?
您不调用
GetSerialization()
,它是由Windows 调用的(例如,通过WinLogon 来执行交互式登录)。您只需填写序列化响应和序列化凭证即可。如果您传回一个响应,表明您已成功从用户收集了凭据,则序列化数据将传递给本地安全机构进行检查。如果您确实想将凭据获取到您自己的应用程序中,可以使用
CredUIPromptForWindowsCredentials
来实现。I wonder whether you have solved this by now?
You don't call
GetSerialization()
, that's called by Windows (e.g. by WinLogon to perform an interactive logon). You just have to fill the serialization response and the serialized credential. If you pass back a response saying that you have successfully collected a credential from the user then the serialized data is passed to the Local Security Authority for checking.If you actually want to get the credentials into your own application you can do so using
CredUIPromptForWindowsCredentials
.