Active Directory身份验证
问题描述:
我的网址是https://some.world.com/xyz/state.asmx
我是新的LDAP身份验证请帮我弄清楚LDAP路径。
或使用交换网址如何验证用户身份。我们需要验证的是什么。
请帮忙..
Hi,
I have url like https://some.world.com/xyz/state.asmx
I am new to LDAP authentication Please help me to figure out the LDAP path.
or using exchange url how can i authenticate user.What are all we need to authenticate.
Please help..
答
请尝试自己搜索或使用Google。
我在几秒钟内发现了这个a href =http://www.codeproject.com/Articles/18742/Simple-Active-Directory-Authentication-Using-LDAP>使用LDAP和ASP.NET进行简单的Active Directory身份验证 [ ^ ]
Please try searching for yourself or use Google.
I found this in seconds Simple Active Directory Authentication Using LDAP and ASP.NET[^]
using Microsoft.Exchange.WebServices.Data;
public static bool ValidateUser(string userName, string password)
{
bool _ExchangeConnected = false;
try
{
String domain = "xy";
String exchangeURL = "url";
String email = "aaaa.abc@mail.com";
userName = String.Format("{0}\\{1}", domain, userName);
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
exchangeService.Credentials = new WebCredentials(userName, password);
exchangeService.Url = new Uri(exchangeURL);
exchangeService.KeepAlive = true;
Mailbox mailbox = new Mailbox(email);
FolderId folder = new FolderId(WellKnownFolderName.Inbox, mailbox);
ItemView view = new ItemView(1);
FindItemsResults<Item> items = exchangeService.FindItems(folder, view);
_ExchangeConnected = true;
}
catch (Exception ex)
{
Logger.CreateLog.LogInfo(ex);
_ExchangeConnected = false;
}
return _ExchangeConnected;
}