Lotus Notes身份验证 [英] Lotus Notes Authentication

查看:120
本文介绍了Lotus Notes身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要通过C#代码对Lotus Notes用户进行身份验证.
我正在使用DirectoryEntry对Active Directory进行用户身份验证,并且工作正常,但是当我对Domino服务器执行相同操作时,我总是会得到一个有效的名称"字段(即使输入了错误的密码).

你能帮忙吗?

谢谢!!!

Hi,
I need to authenticate a lotus notes user from my C# code.
I am using DirectoryEntry to authenticate a user against Active Directory and it works fine, but when I do the same against Domino server I am always getting a valid "Name" field (Even for wrong password).

Can you help?

Thanks!!!

推荐答案

私有DirectoryEntry条目;
entry = new DirectoryEntry("LDAP://" + oDomainName +",oUserName,
oPassword,System.DirectoryServices.AuthenticationTypes.Secure);

私有DirectorySearcher ds;
entry = new DirectoryEntry("LDAP://" + oDomainName +",oUserName,
oPassword,System.DirectoryServices.AuthenticationTypes.Secure);

private DirectoryEntry entry;
entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName,
oPassword, System.DirectoryServices.AuthenticationTypes.Secure);

private DirectorySearcher ds;
entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName,
oPassword, System.DirectoryServices.AuthenticationTypes.Secure);

Then made a search in active directory against your login credentials, if searchresult returns object of the user it means that user exist in the Active Directory with the submitted credentials.
The source code also contains a method "GetDomains" which returns an ArrayList having all the domains that are present in the network

.

公共ArrayList GetDomains()
{
ArrayList arrDomains = new ArrayList();
DirectoryEntry ParentEntry =新的DirectoryEntry();
试试
{
ParentEntry.Path ="WinNT:";
foreach(ParentEntry.Children中的DirectoryEntry childEntry)
{
开关(childEntry.SchemaClassName)
{
案例域":
{
arrDomains.Add(childEntry.Name);
休息;
}
默认值:
{
休息;
}
}}}
catch(异常e)
{
}
终于
{
ParentEntry = null;
}
返回arrDomains;
}


试试这个,让我知道这东西是否可以正常工作

.

public ArrayList GetDomains()
{
ArrayList arrDomains = new ArrayList();
DirectoryEntry ParentEntry = new DirectoryEntry();
try
{
ParentEntry.Path = "WinNT:";
foreach (DirectoryEntry childEntry in ParentEntry.Children)
{
switch (childEntry.SchemaClassName)
{
case "Domain":
{
arrDomains.Add(childEntry.Name);
break;
}
default:
{
break;
}
}} }
catch (Exception e)
{
}
finally
{
ParentEntry = null;
}
return arrDomains;
}


Try this and let me know if this thing work aur not


这篇关于Lotus Notes身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆