Search code examples
wcfwshttpbindingbasichttpbinding

basicHttpBinding with custom login/password and HTTPS


After a lot of googling, i ask for your help for a problem who seems to be easy but... really not.

How can i use custom login/password like in this tutorial with basichttpbinding instead of WSHttpBinding ? http://codebetter.com/petervanooijen/2010/03/22/a-simple-wcf-service-with-username-password-authentication-the-things-they-don-t-tell-you/

I need this because clients for my webservice could be in PHP and i found that WSHttpBinding don't works with PHP Soap implementation.

Thank's by advance !


Solution

  • Ok so finally i'm done without HTTPS but it works !

    I used the following links to generate a clean webservice :

    http://channel9.msdn.com/Shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Service http://laedit.developpez.com/PHP/CSharp/Interoperabilite/#LIV (in french, show the wcf par)

    And then, i finally make a app.config file who works : http://pastebin.com/cVGC88Gj .This is a modified version of the example made in the second link.

    And this is the custom authentification code : http://pastebin.com/QucGKqZt

    Remember that this code NEVER HAD TO BE IN PRODUCTION. PASSWORDS ARE SENT IN CLEAR IN HEADERS. But for developing it's clean and simple ;-)