久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Active Directory PrincipalContext.ValidateCredentials 域消歧

Active Directory PrincipalContext.ValidateCredentials domain disambiguation(Active Directory PrincipalContext.ValidateCredentials 域消歧)
本文介紹了Active Directory PrincipalContext.ValidateCredentials 域消歧的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在處理兩個域 - 一個是受信任域.一個域上可能有一個 JohnSmith,另一個域上可能有另一個 JohnSmith.這兩個人都需要登錄我的應(yīng)用程序.

I'm dealing with two domains - one is a trusted domain. There may be a JohnSmith on one domain and another JohnSmith on the other. Both of these people need to log into my application.

我的問題:我傳入哪個域并不重要 - 此代碼返回 true!我如何知道哪個 JohnSmith 正在登錄?

My problem: it doesn't matter which domain I pass in - this code returns true! How do I know which JohnSmith is logging in?

    static public bool CheckCredentials(
        string userName, string password, string domain)
    {
        using (var context = new PrincipalContext(ContextType.Domain, domain))
        {
            return context.ValidateCredentials(userName, password);
        }
    }

推薦答案

ValidateCredentialsuserPrincipalName 一起使用,您也許可以嘗試構(gòu)建第一個參數(shù)(用戶名)登錄和域來創(chuàng)建用戶名 JohnSmith@dom1.comJohnSmith@dom2.com.

The ValidateCredentials works with userPrincipalName you perhaps can try to build the first parameter (username) combining the login and the domain to create the username JohnSmith@dom1.com versus JohnSmith@dom2.com.

這篇關(guān)于Active Directory PrincipalContext.ValidateCredentials 域消歧的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應(yīng)該總是在 C# 中使用可空類型)
C# HasValue vs !=null(C# HasValue vs !=null)
C# ADO.NET: nulls and DbNull -- is there more efficient syntax?(C# ADO.NET:空值和 DbNull —— 有沒有更高效的語法?)
How to set null value to int in c#?(如何在c#中將空值設(shè)置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調(diào)用)
主站蜘蛛池模板: 日韩欧美国产精品 | 久久久久久久久久久久91 | 精品一区二区三区在线观看国产 | 操久久 | 久久精品日产第一区二区三区 | 免费在线成人 | 欧美国产精品一区二区三区 | 国内精品久久久久久久 | 视频1区 | 不卡一二三区 | 日韩视频一级 | 91久久精品视频 | 成人高清在线 | 欧美日韩久久 | 超碰520| 美女视频h | 99爱在线视频 | 久久久久久亚洲国产精品 | 久久在线免费 | 中文字幕精品一区二区三区精品 | 日韩av一区二区在线观看 | 国产精品久久久久久av公交车 | 国产99久久精品一区二区永久免费 | 久久亚洲一区二区三区四区 | 国产免费一区二区 | 久久日韩粉嫩一区二区三区 | 免费久久精品视频 | 国产日韩久久 | 欧美精品久久久 | 中文在线www | 一级全黄少妇性色生活免费看 | 香蕉一区| www.日韩| 国产精品中文字幕一区二区三区 | 天天弄| 久在线 | 在线观看免费国产 | 国产免费va | 欧美精三区欧美精三区 | 中文字幕在线免费视频 | av电影一区二区 |