Wednesday, 15 June 2011

c# - WCF service with Windows Authentication accessed from desktop and web -


The WinForms app that I have a Aspiknet Web site and connected to the same WCF service.

web.config of WCF services, is binding on app.config of WinForm application, and website looks like web.config is:

  & lt; Ws2007httpBinding & gt; & Lt; Binding name = "lbidadding" message encoding = "ammut" & gt; & Lt; Security mode = "message" & gt; & Lt; Transport Customer Credential Type = "Windows" /> & Lt; Message client CredentialType = "Windows" /> & Lt; / Safety & gt; & Lt; / Binding & gt; & Lt; / Ws2007httpBinding & gt;  

Both desktop applications Web site, I speaking DoSomething () service on Host function:

  l Client = New alcultant (); client.ChannelFactory.Credentials.Windows.ClientCredential.UserName = usernameTextBox.Text client.ChannelFactory.Credentials.Windows.ClientCredential.Password = passwordTextBox.Text client.DoSomething ()  

username / password Windows domain credentials user name as follows: domain \ username

both the desktop app and web site, Windows authentication does work correctly when the user enters combining the correct username / password < / P>

However, the web site, when the user is a valid user Name, and enters the wrong password, and clicks on the submit button to validate your credentials, DoSomething method seems to "hang", in fact, it never makes the DoSomething () on the server I The desktop app has just waited for a few minutes, and the browser does not seem to go back to DoSomething () call.

On the other hand, when the user enters a valid user name and wrong password, the default window security dialog appears. If the user enters the correct credential, then dosoming () is successfully called, if they enter the wrong password, then the same default window security dialog is shown again, asking the user to re-enter their credentials is.

http://i.stack.imgur.com/hX8bS.png

My questions are:

  1. Why does nothing () hang on the web site, but not on the desktop app
  2. Perhaps, there is something to do with the desktop app that is showing the default window security dialog? There is a way to shut it down
  3. Obviously, in IE, if you go to Internet Options -> custom level> User authentication and radio box "prompt for username and password" Select the default Select Window Security dialog, the user asks to re-enter their credentials I do not like this solution because the user needs to modify their IE settings So there is

  serviceClient.ClientCredentials.SupportInteractive = false;  

No comments:

Post a Comment