locked
DataServiceHostFactory and IIS Hosting RRS feed

  • Question

  • Hello,

    In the article Using ADO.NET Data Services, Mike Flasko demonstrates how to create a simple ASP.NET Web Application that hosts an ADO.NET Data Service.

     

    The problem in this sample is that IIS must be configured to accept only anonymous requests. If Windows Authentication is turned on the following message is displayed when running the service :

    _____________________________________________________________________________________

    IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    _____________________________________________________________________________________

     

    There is a way to work around this, just enable only anonymous request to the web application in IIS configuration, but this is not what I wanted.

     

    I'm using Frontpage Server Extensions to publish my web site and I do not want to temporarily enable Windows Authentication to be able to do that.

     

    I understand that in an internet context, the service is not secured but the operations, what about an intranet context ??

    Should I override DataServiceHostFactory to change the behavior ? May be change the configuration file to specify a custom binding ?

     

    Any help appreciated.

    TIA.

    Olivier.

    Tuesday, September 23, 2008 8:34 AM

Answers

  • The WCF Binding we use requires that you have only one Authentication scheme defined.

    If you have more than one shceme selected for a website hosting an astoria service , you will get the error above.

    If you dont want to change the authentication scheme for the website , you can change the authentication for only the astoria service via web.config or IIS .

     

    What is the scenario for you to have multiple authentication schemes selected for an astoria service ?

     

     

    Monday, September 29, 2008 6:30 PM
    Moderator

All replies

  • Hi,

     The above error message is seen when you have an astoria service hosted in a website/Virtual Directory which has more than one authentication scheme defined.

     When you turn on Windows AUthentication , Is the option for anonymous Authentication also checked ?

    from the description it looks like both are turned on and you disable anonymous when you use Frontpage Extensions to publish the website.


    Which Operating system are you trying to host the service on ?

    WIn 2k3/Win 2k / Vista ?

     

    Thursday, September 25, 2008 6:25 PM
    Moderator
  • Yes, Anonymous Authentication is also checked when I turn on Windows Authentication.

    The service is hosted on IIS7/Windows Server 2008.

    Fortunately, there is no need to restart the application pool's worker process to benefit from the change.

     

    Are you telling me that we could not have more than one authentication scheme defined ?

    TIA.

    Friday, September 26, 2008 8:07 AM
  • The WCF Binding we use requires that you have only one Authentication scheme defined.

    If you have more than one shceme selected for a website hosting an astoria service , you will get the error above.

    If you dont want to change the authentication scheme for the website , you can change the authentication for only the astoria service via web.config or IIS .

     

    What is the scenario for you to have multiple authentication schemes selected for an astoria service ?

     

     

    Monday, September 29, 2008 6:30 PM
    Moderator
  • Apart from the publishing requirement, there is no need to have multiple authentication schemes.

    Tuesday, September 30, 2008 6:53 AM