.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

helped needed: ASP LDAP authentication failed in IE 8

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I use the following code to do the user authentication through Active Directory using LDAP.

entry = new DirectoryEntry("LDAP://" + server, user_name, password);
if (!string.IsNullOrEmpty(entry.Name))
EmployeeNetId = entry.Username.Substring(0, 3);

// Retrieve EmployeeId, and Employee Full Name
EmployeeId = -1;

It works for Chrome, Firefox with no problem. But with IE 8, it works sometimes, and failed on some computers. When it failed, I figured that I need to check SSL 2.0 in IE 8 Internet Options.  It's weird because in those computers that IE 8 works, SSL 2.0 is also unchecked.

Am I using some deprecated method? Or How do I specifiy the SSL version options in the LDAP connection?

View Complete Post

More Related Resource Links

help needed: Ldap User authentication using userDN and password



Is it possible to authenticate a user using userDN and password? If so, then tell me the syntax.So far i have tried to authenticate using username and password from my c# code using directoryentry which takes the parameters like domainname,username and password. But i need to authenticate using Userdn and password.

How to authenticate local user usin ldap or non domain authentication



I created one application, and I need to authenticate local user. This user is the user who is login to his/her Personal Computer.. Main thing his that he/she does not in any DOMAIN... I want NON-DOMAIN authentication.. any how.... please help...

Solved: LDAP authentication: error code 49 - 80090308, comment: AcceptSecurityContext error, data 52

Hi, I have a problem conneting to another domain (far.away.domain). We have a two-way trust to this domain. Also I can access the DS using ADSI edit and our Administrator account (ourdomain.com). I tried several types of credentials (userid = "CN=Administrator,CN=Users,DC=ourdomain,DC=com", "Administrator @ ourdomain.com" (without blanks)...). Connecting to ourdomain.com is no problem, but to far.away.domain I can't connect, I always get the error 525 (user not found). What could be the problem? Have I to use an entry from the ForeignSecurityPrincipals CN of the far.away.domain? I also tried to connect using Softerra LDAPBrowser and a command line ldapsearch without succes and with not a better error message. But why is it not possible to use a trusted account, or is this a active directory feature and does not work with pure LDAP bindings? Best regards, Nils.

LDAP - directory entry issue with out user and password using impersonate and windows authentication

Hi All I am using the below code to fetch the user information from LDAP             DirectoryEntry entry = new DirectoryEntry("LDAP://DEV");             DirectorySearcher searcher =  new DirectorySearcher(entry);             SearchResult result;             searcher.Filter = "samaccountname=testuser";             result = searcher.FindOne(); here i am using windows authentication always and along with that when i enable the impersonate = true ,  the code fails at "result = searcher.FindOne();" with message "object reference not set to instance of an object "  also with the same code if i give the username and password along with the impersonate tag >> it works  or if i am using the user and password along with the DirectoryEntry  object then also it will work  but it fails with same user that i gave in impersonate tag / directory entry object with windows authentication enabled  and the  user logged to the application and no username and password tag in directory entry / impersonate tag  Interesting thing is that  in our development server ,  i am able to execute the same code with out user name p

OU level authentication - AD/Ldap

I want to write a process where i need to authenticate an user against a particular OU in Active Directory. If the AD holds 50 OUs I don't want the process to look into all 50 OUs , instead it should look into a particular OU( for eg: OU=dotnet users)  to authenticate the user. This is to improve the performance by avoiding the time for looking into the entire directory. How can I achieve this? Appreciate your help!

PassThrough authentication fails: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

I've tried it with every AuthenticationMode! But no one seems to work correctly in my case. I thought that PassThrough should work with a preset User ID and password. This would be enough for the moment, but even this doesn't work!! With WindowsCredentials I get the following error: The Property with name 'SsoApplicationId' is missing on the LobSystemInstance. SsoApplicationId I tried to set this with the SharePoint SSO but I've no such services. How can I set this just for the current WindowsCredentials (of the current Sharepoint user)? With RevertToSelf I get the following error: "An error occurred while retrieving data from MyLOBInstance. Administrators, see the server log for more information." The server log contained no useful information for me. With PassTrough I get the following error: "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]" Why are the lines <Property Name="RdbConnection User ID" Type="System.String">MyDomain\Administrator</Property><Property Name="RdbConnection Password" Type="System.String">mYpAssWoRd</Property> being ignored? Everything (MOSS, SQLServer,...) is on a single machine, so I don't need to activate Kerberos, do I? <LobSystemInstance Name="SEPInstance1207">   <Properties>    <Property Name="DatabaseAccessProvider" Type="Micros

Office SharePoint - Mutual Authentication Failed. The servers password is out of date at the domain

I have a SharePoint Server 2010 site setup with SSL. (https://sitename.com) Whenever someone tries to save an Excel or Word document to the site through Save As or Save To SharePoint they get "Mutual Authentication Failed. The servers password is out of date at the domain controller". The desktop experience feature is installed and the webclient service is running. They also receive certificate is not available and if they wait a little bit or hit OK it will show the directory and not the website like on a regular http site.  

LDAP Authentication against SunOne using getdirectoryentry method of directorysearcher object in Asp

Hi All,
I am authenticating user in following way but it says "unknown username or password" even though I provide correct username and password. I am authenticating against Sunone directory server. Unfortunately as per rquirement I could not bind any user with the direcory except service username and password.

I could not figure out whether this correct way or not. Any help would be appreciated.

DirectoryEntry entry = new DirectoryEntry("LDAP URL");

entry.AuthenticationType = AuthenticationTypes.ServerBind;
entry.Username = "uid=thost,ou=somthing,dc=something,dc=something";
entry.Password = password;
DirectorySearcher search = new DirectorySearcher(entry);

search.Filter = "(uid=" + actualUid + ")";
SearchResult rc = search.FindOne();


DirectoryEntry de = rc.GetDirectoryEntry();
de.Password = actualPassword;
object o = de.NativeObject;

catch (Exception ex)

LDAP authentication for asp.net application


Hi All,

I am working for a bank and we have so many branches with users in Active Directory. I need to develop application in such a manner that when user logged in windows and run my application it picks the username for example  john.lennon  and validate its password using LDAP and redirect it to the main page of application and dont allow annonymous access.

Secondly I want to fill the grid with all the users exist in my organization Active Directory with the userid, username, email and etc so I can create and assign roles ..how to achieve this?

Please answer both of my questions i would appreciate.


WCF: security token could not be satisfied because authentication failed.



I am newbie to WCF.... Please bare me..I have WCF service and client on the same machine with certificates(trusted root authority). Please find Client and server config below.

Below exception resulted when client tries to call service.

NOTE: This exception resulted when revocationMode= Online. But this is working fine when revocationMode= NoCheck.

<authentication certificateValidationMode="ChainTrust" revocationMode="Online"/>

But this should work in Online revocation mode for me.


Server Error in '/WCFClient' Application.

The request for security token could not be satisfied because authentication failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException: The request for security token could not be satisfied because authentication failed.

Source Error:

Line 58:     }
Line 59:
Line 60:     public string Ping(string inParam) { return base.Channel.Ping(inParam);

[FtpWebRequest] System.Security.Authentication.AuthenticationException: A call to SSPI failed


Hi All,

   I'm using FtpWebReuqest, SSL enabled, to connect and upload files to an FTP server.

   During testing of the module i'm developing, I've encountered an unhandled exception indicating,

   "System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The token supplied to the function is invalid"


Now before I decided to post this question here, I've searched the net and found several posts related to this. However, most them were not really helpful and not that clear. Hence, the post. :)

Additional info, I've already over ride the validation part of the SSL connection using the codes below:


ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(MyCertValidationCb);

public static bool MyCertValidationCb(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)


        return true;



What I can't really figure out is the root caus

Windows 2008 Server: Authentication failed because the remote party has closed the transport stream


Hi, I am trying to use TLS to connect to the Windows 2008 Server from windows XP, I set Authentication=False.

It throws the below authentication exception when connected to WIN 2008 Server with SP2, where as it used to work fine with WIN 2003:

System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Below is the sample code.


protected Stream stream;

IPEndPoint ipe = new IPEndPoint(addr, port);

Socket socket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);


socket .SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, options.keepAlive);
socket .LingerState = new LingerOption(options.lingerTime >= 0, options.lingerTime >= 0 ? options.lingerTime : 0);
socket .NoDelay = options.noDelay;

stream = new SslStream(stream, false, new RemoteCertificateValidationCallback(true), null);


I am using .Net 3.0 Frame work & VS 2005

Any help over here is highly appreciated.



LDAP Authentication Provider


I am trying to import user profiles into my SP2007 test setup. I am using an LDAP connection so I can import the profiles from a specific OU. In the connectin settings a "Provider" is asked for. I am using a Win2003 domain.

I have no idea what an LDAP provider is.

The request failed with HTTP status 407: Proxy Authentication Required (the ISA server requires auth


I'm new to webservice. I writed an example to work with a web service which is supplied on Internet (its url: http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx ) when i tried running i got an error message as System.Net.WebException was unhandled
  Message="The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.  )."

I had found some solutions such as:
+ using ISA firewall
+ configuring proxy from Machine.config
+ inside coding

The first:  I used ISA firewall but i still got the same error, my problem didn't resolve. I guessed that is because ISA firewall needn't use Credentials (username/password).

The second:
 I tried coding in my source, it was okie. This solution is good because following this way i can get defaultCredentials from cache but needn't define straightforwardly my credentials as username/password
my code is as follows:

DelayedStockQuote wsStock =

Authentication failed as remote party has closed the transport stream



Hi All,

I am getting following message:


Message = " Authentication failed because the remote party has closed the transport stream."


NOTE: In my case client and Server both are on the same machine, so I passing the same values for machineName and serverName to the following method


public static void RunClient(string machineName, string serverName)


// Create a TCP/IP client socket.

// machineName is the host running the server application.

TcpClient client = new TcpClient(machineName, 443);


Login failed for user '...\ASPNET' only with parameterized query using SQL Server Authentication


Hi there,

I've narrowed the problem down to the following:

  • Receive "Login failed" for user ASPNET error message
  • SQL Server 2005 is db and IIS is web server (both on same computer)
  • Mixed authentication used on SQL Server
  • I have created user ASPLogin with password that is correctly typed int the web.config:


add name="masterConnectionString" connectionString="Data Source=computername\GMOSERVER;Initial Catalog=Portal;Persist Security Info=True;User ID=ASPLogin;Password=password<

SQL Server 2008 -- MS Access 2003 Linked server -- Authentication failed


I am trying to link SQL Server 2008 - 64 to an MS Access database on a network share. I can get the link to work from the SQL management studio but when I try to do a ODBC query (from another machine)  of a view table pointing to the access db through a linked server using the "Microsoft.ACE.OLEDB.12.0"driver.  The error from the odbc trace is:

"        DIAG [01000] [Microsoft][SQL Server Native Client 10.0][SQL Server]OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "STPRD" returned message "Not a valid account name or password.". (7412) "

Yes the login to the password are good.  I have tried various setting using sp_addlinkedsrvlogin function but nothing will handle the extra hop.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend