简体   繁体   English

Windows 10 自定义凭证提供者

[英]Windows 10 custom credential provider

recently I'm trying to make a custom credential provider for windows 10 and I ended up with a sample code provided by Microsoft for Windows 8.1 ( https://learn.microsoft.com/en-us/samples/microsoft/windows-classic-samples/credential-provider/ ).最近我正在尝试为 windows 10 创建一个自定义凭据提供程序,最后我得到了 Microsoft 为 Windows 8.1 ( https://learn.microsoft.com/en-us/samples/microsoft/windows-classic -样本/证书提供者/ )。 I've tried to make it work on my computer but I can't.我试图让它在我的电脑上运行,但我做不到。 It just compiles and makes a `SampleIcredentialProviderV2.dll but it's not working.它只是编译并生成一个 `SampleIcredentialProviderV2.dll 但它不工作。 I click on the registry file within the project folder but it's still not showing up on my login page?我单击项目文件夹中的注册表文件,但它仍然没有显示在我的登录页面上? Does anyone have experience with this code?有没有人有这段代码的经验? how can I make this work.我怎样才能使这项工作。 thanks.谢谢。

Most likely windows can't find your dll or your credential provider has not been properly registered.很可能 windows 找不到您的 dll 或您的凭证提供者未正确注册。

There are two things to understand to know how a credential provider is created.要了解如何创建凭据提供程序,需要了解两件事。

First, all registered credential providers on a computer can be found in this registry location:首先,可以在此注册表位置找到计算机上所有已注册的凭据提供程序:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers

All the subkeys are the GUID (or CLSID) that uniquely identify a COM object, but also a credential provider since they have to implements the IFactory/IUnknown COM interface.所有子项都是唯一标识 COM object 的 GUID(或 CLSID),但也是凭据提供程序,因为它们必须实现 IFactory/IUnknown COM 接口。 Things like {25CBB996-92ED-457e-B28C-4774084BD562}.像 {25CBB996-92ED-457e-B28C-4774084BD562} 这样的东西。

Windows will iterate through all those CLSID and if not filtered will try to create an instance of the corresponding credential provider. Windows 将遍历所有这些 CLSID,如果未过滤,将尝试创建相应凭据提供程序的实例。 In order to do so, it will look into为此,它将调查

HKEY_CLASSES_ROOT\CLSID

All the subkeys here represents a COM object. Your credential provider CLSID must be present here too.此处的所有子项代表 COM object。您的凭据提供程序 CLSID 也必须出现在这里。 And here comes the second part, inside it there is another subkey, InProcServer32, containing a default value representing where to find the dll associated with this CLSID.这是第二部分,其中有另一个子项 InProcServer32,包含一个默认值,表示在哪里可以找到与此 CLSID 关联的 dll。

It can either be just the dll name but then it has to be in your PATH environment variable or in the windows/system32 folder, or it can be a full filepath.它可以只是 dll 名称,但它必须位于您的 PATH 环境变量或 windows/system32 文件夹中,或者它可以是完整的文件路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM