Windows自定义登录认证开发-C#
Windows自定义登录认证开发-C#
沉默狮 发表于1年前
Windows自定义登录认证开发-C#
  • 发表于 1年前
  • 阅读 43
  • 收藏 0
  • 点赞 0
  • 评论 0

标题:腾讯云 新注册用户域名抢购1元起>>>   

在官网找到个C++ Demo,通过查看源码得知需要自己编写一个 credential provider的C++类,继承于ICredentialProvider (credentialprovider.h) 这个接口。

stack overflow上有个哥们儿这么说道:

The new CredentialProvider model in Windows Vista and higher is based on COM. This means that it should be possible as long as you implement the correct COM interfaces.

Based on this, it should be easier to build than the older GINA model since the older GINA module used DLL entry points and function pointers instead of COM interfaces.

Given the ability for .Net to inter-operate with COM, it should be as easy as:

  1. Building a C# definition of the ICredentialProvider interface and adding the correct COM attributes with the correct GUIDS
  1. Building a credential provider class that implements the ICredenitalProvider and is marked as COMVisible(True)
  1. Registering the new assembly with Regasm
  1. Adding the correct registry keys to register your new CredentialProvider with Windows (Software\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers)

If you do all of that, you will have a working credential provider, written in C#

他的意思大概就是Vista以后的ICredentialProvider接口都是基础COM来实现的,C#处理起来COM很容易,直接在C#里面声明这个接口再实现它吧,你将会很简单的完成这个东东。

然而有更多的人直接推荐了pgina 这个三方库,它主要是就是做自定义的windows凭据校验。如果你不需要太多的验证,高度的自定义,你可以写一个它的插件(托管代码)来实现你自己的东东。

共有 人打赏支持
沉默狮
粉丝 10
博文 53
码字总数 24758
×
沉默狮
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: