none
WCF Service security with a custom username and password RRS feed

  • Question

  • Hi,

    I am new for WCF service. I have finished my WCF service code and now I need to set security for it. I am using this way to do the security: http://msdn.microsoft.com/en-us/library/aa702565(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-5, but my manager doesn't like this way. He wants users to input username and password when they connect to our web service. I mean that a login screen pops up and asks users to input username and password when users Add Service Reference and input service Address and then press Go button. Please see the picture below. Could you tell me if it is possible to set and how to do this? Thanks you so much!

    Saili

    Monday, July 14, 2014 1:45 PM

All replies

  • Hi,

    The web services which have either Integrated Windows Authentication or Digest Authentication settings in IIS will require authentication credentials when trying to add those web service references from Visual Studio. That means when trying to add web service using Visual Studio, it will prompt for Username, Password and Domain credentials, after giving the correct credentials, a proxy will be created. Then for the custom username and password authentication I did not see the dialogue box when I did the test, the following image appeared when I used the windows authentication:

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, July 15, 2014 8:43 AM
    Moderator
  • Thank you so much, Amy! Your post helps me very much! I have set windows authentication already but I don't know what the username and password are. When I test it, I input my computer's login name and password, server's login name and password, but the login screen still kept popping up and not disappear. It seems like the username and password are not correct. Could you tell me what the username and password should be? If I want a special username and password only for my project, how should I set them?

    Thank you so much!

    Saili

    Tuesday, July 15, 2014 1:59 PM
  • Hi,

    Is your computer in the domain environment? If so, then the windows username is the DOMAIN\username. Once we have configured the WCF Service with the Windows authentication, then the client who wants to access the service can use their own domain account to access it.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, July 16, 2014 8:33 AM
    Moderator
  • Hi,

    Thank you so much, Amy. I find my computer and our server are in the same intranet and they have the same domain. So when I set window authentication, the Discovery Credential screen won't pop up and the authentication can identify the client (my computer) automatically. My question is if I would like to set some username and password created by myself and let users to input them in the Discovery Credential screen, how should I do the settings?

    Thank you so much!

    Saili

    Thursday, July 17, 2014 7:20 PM