簡體   English   中英

如何提取通過WCF應用程序中的NetworkCredentials類發送的憑據?

[英]How to extract the credentials sent through NetworkCredentials class in WCF Application?

我正在一個項目中,憑據是通過WindowsCredentials對象從Windows mobile(Compact Framework)發送的。 我需要從標頭中提取憑據,並針對WCF應用程序中的LDAP服務器進行身份驗證。 有辦法嗎? 任何建議都將受到歡迎!

您無需提取憑證,就可以將NetworkCredential對象Dirclty傳遞給LDAP:

public static bool login(string domain, System.Net.NetworkCredential cred)
{
    try
    {
        LdapConnection conn = new LdapConnection(domain);
        conn.Bind(cred);
        return true; 
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM