Last post Mar 19, 2015 08:46 PM by physicsmaster
Mar 18, 2015 01:02 PM|physicsmaster|LINK
I have a ASP.NET web site and a WinForms app connecting to the same WCF service.
The binding on the WCF service's web.config, WinForm app's app.config, and website web.config looks like:
<binding name="LBinding" messageEncoding="Mtom">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
In both the desktop app the web site, I am calling the DoSomething() function hosted on the service:
LClient client = new LClient();
client.ChannelFactory.Credentials.Windows.ClientCredential.UserName = usernameTextBox.Text
client.ChannelFactory.Credentials.Windows.ClientCredential.Password = passwordTextBox.Text
The username/password are the Windows domain credentials. The username is in the form: domain\username
In both the desktop app and the web site, the windows authentication works perfectly when the user enters in the correct username/password combination.
However, on the web site, when the user enters in a valid username, and incorrect password, and clicks on the submit button to validate their credentials, the DoSomething method seems to "hang"; actually, it never even makes it to DoSomething() on the server.
I have waited a few minutes, and the browser does not seem to be returning from the DoSomething() call.
On the other hand, in the desktop app, when the user enters in a valid username and incorrect password, the default windows security dialog appears. Here, if the user enters in the right credentials, DoSomething() is called successfully, if they enter in
the wrong password, the same default windows security dialog shows up again, asking the user to reenter their credentials.(i.e.,
My questions are:
1.Why does calling DoSomething() seem to hang on the web site, but not on the desktop app.
2.Perhaps, it has something to do with the desktop app showing the default windows security dialog. Is there a way to turn this off?
Mar 19, 2015 08:11 AM|mgebhard|LINK
Windows authentication allows users to open application resources using their network login. If the site is asking for credentials, then you have a configuration issue.
Is the desktop app running under the user's account? What about the web app?
Mar 19, 2015 08:46 PM|physicsmaster|LINK
The desktop app is ran on a computer that is not on the network, and the browser that accesses the web app is also not on the network.
On the login form for both apps, the user enters in the username(domain\username) and password. When the user enters it correctly, DoSomething() runs fine.
The app.config seems correct in the desktop app, as when the user enters in the wrong password, DoSomething() doesn't hang. The same binding is used in the web.config of the website, but strangely hangs when a incorrect password is specified.
Also, when the user enters in the wrong domain in the username, DoSomething returns immediately specifying that the credentials are invalid(which is expected). The problem only seems to happen on the website, when the user enters in the correct domain, but