.Net's Directory Services throws a strange exception

后端 未结 4 1691
孤城傲影
孤城傲影 2020-12-03 20:52

I have a small C# solution used to check users credentials. It works fine for two of my teammates, but on my PC I get an exception.

The relevant code:



        
4条回答
  •  青春惊慌失措
    2020-12-03 21:13

    I had this problem too using IIS Express and VS 2010. What fixed it for me was a comment on another thread.

    Validate a username and password against Active Directory?

    but i'll save you the click and search... :) Just add ContextOpations.Negotiate to you Validate Credentials call like below.

    bool valid = context.ValidateCredentials(user, pass, ***ContextOptions.Negotiate***);
    

提交回复
热议问题