locked
ASP.NET Application Services, WS-Security and Data Services RRS feed

  • Question

  • Hello

     

    I would like to set up my Data Service as a WS-Security service over https, authenticating to a ASP.NET Security Application Service. I have done this for other WCF web services.

     

    Is it possible to configure the Data Service like this as it does not seem to expose any WCF configuration in the Web.config file? I assume all the configuation is done in code(creating bindings, endpoints etc)?

     

    Vicente

    Monday, February 4, 2008 10:12 AM

Answers

  • ADO.NET Data Services are WCF services and I have applied service configuration for them in my web.config:

    <service behaviorConfiguration="ServiceBehavior" name="ModelNamespace.MyEntities">
       <endpoint address="" binding="webHttpBinding" contract="Microsoft.Data.Web.IRequestHandler">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>
    </service>


    I implemented a custom authorization manager for this service:

    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehavior">
                <serviceAuthorization serviceAuthorizationManagerType="MyNamespace.AuthManager, MyAssembly" principalPermissionMode="UseAspNetRoles">
                  <authorizationPolicies>
                    <add policyType="MyNamespace.AuthPolicy, MyAssembly" />
                  </authorizationPolicies>
                </serviceAuthorization>
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>


    You may find this blog post useful:
    http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/01/15/10119.aspx

    Wednesday, May 7, 2008 3:30 PM

All replies

  • Has anyone got any guidance on doing this, I'm looking to do exactly the same as Vicente apart from I want to use the ASP.NET membership provider.

    Thanks,

    ll
    Friday, May 2, 2008 4:25 PM
  • ADO.NET Data Services are WCF services and I have applied service configuration for them in my web.config:

    <service behaviorConfiguration="ServiceBehavior" name="ModelNamespace.MyEntities">
       <endpoint address="" binding="webHttpBinding" contract="Microsoft.Data.Web.IRequestHandler">
         <identity>
           <dns value="localhost" />
         </identity>
       </endpoint>
    </service>


    I implemented a custom authorization manager for this service:

    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehavior">
                <serviceAuthorization serviceAuthorizationManagerType="MyNamespace.AuthManager, MyAssembly" principalPermissionMode="UseAspNetRoles">
                  <authorizationPolicies>
                    <add policyType="MyNamespace.AuthPolicy, MyAssembly" />
                  </authorizationPolicies>
                </serviceAuthorization>
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
        </serviceBehaviors>
    </behaviors>


    You may find this blog post useful:
    http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/01/15/10119.aspx

    Wednesday, May 7, 2008 3:30 PM