Login dialog from WCF client RRS feed

  • Question

  • We just found a very strange issue with WCF client. In some circumstances, instead of throwing Exception the login dialog is appered.

    It could be ok for windows application, but what if it appears in non-UI thread.

    It happens when custom windows credentials are specified and password is incorrect, but user name is correct. If incorrect user is specified the code works as expected and
    System.ServiceModel.Security.SecurityNegotiationException "The caller was not authenticated by the service." is raised.

    wsHttpBinding binding with message security and Windows authentication is used.

    <security mode="Message">
    	<message clientCredentialType="Windows" />
    The code is very simple:
    var client = new ServiceClient();
    client.ClientCredentials.Windows.ClientCredential = 
    new NetworkCredential("USER", "INCORRECT PASSWORD", "DOMAIN"); client.CallMethod();

    Thank you in advance

    Thursday, March 7, 2013 4:10 PM

All replies

  • Hi,

    For the login dialog you showed is not supposed to occur for web application that use forms authentication(which should use a login.aspx page for authentication), it is for demanding windows authentication(or basic authenticaiton) credentials from client side.

    Best Regards.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 8, 2013 6:55 AM
  • Actually the question is why it's appeared in some cases. We would like to handle such behaviour explicitly by handling exceptions.

    It could be a big problem for server-side applications (server -> server) communications where no UI is available.

    Friday, March 8, 2013 9:40 AM