Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8269585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:16:56+00:00 2026-06-08T06:16:56+00:00

(WCFDS = WCF Data Services 5,backed by Entity Framework, using oData v3, formatted as

  • 0

(WCFDS = WCF Data Services 5,backed by Entity Framework, using oData v3, formatted as JSON, served up via IIS7 and protected by Windows authentication.)

The crux is accessing the WCFDS in an authenticated manner from an AJAX call.

To this end, I have a client as an ASP.Net Web Application with Windows authentication set in Web.config and a Service Reference pointing to the WCFDS.

I want to use client-side JavaScript to access the Service Reference. How can I do this?

I thought about creating an aspx page, hosting in the client and direct calls from JavaScript code to this page, which would then retrieve data through the Service Reference – but I’m at a loss over how to expose the full functionality of the Service Reference in this manner (there are dozens of entities).

Can anyone help with advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:16:58+00:00Added an answer on June 8, 2026 at 6:16 am

    The Windows authorization settings in web.config are not directly related to WCF Data Services, so you probably won’t need to set anything there. You WILL need to set your settings up properly in IIS.

    There are a number of good articles out there about using Windows authorization over WCF Data Services; in a nutshell you have a wide degree of freedom in how you choose to expose authorization (ranging from filtering out individual entities from a feed to throwing 401/403s).

    A couple of good articles to read through:

    • http://msdn.microsoft.com/en-us/data/gg192997
    • http://blogs.msdn.com/b/astoriateam/archive/2010/07/21/odata-and-authentication-part-7-forms-authentication.aspx (yes, I know that’s forms auth but the auth part of this is entirely orthogonal to what the code looks like in your WCF Data Services)
    • http://blogs.msdn.com/b/astoriateam/archive/2010/07/19/odata-and-authentication-part-5-custom-httpmodules.aspx

    The simplest code you could possibly write would be something along the lines of:

    namespace Scratch.Web
    {
        [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
        public class ScratchService : DataService<ScratchContext>
        {
            [QueryInterceptor("Products")]
            public Expression<Func<Product, bool>> ProductsAuthorization()
            {
                if (!HttpContext.Current.Request.IsAuthenticated)
                {
                    return (p) => false;
                }
                return (p) => HttpContext.Current.User.IsInRole("AllowAccessToProducts");
            }
    
            // ...rest of service code...
        }
    }
    

    Note that everything on the client side is controlled by the browser, so you don’t really need to do anything there (the biggest step might be to add the site to Trusted Sites so it doesn’t prompt you for your credentials if you’re on a domain-joined machine).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using WCF Data services with Entity Framework 4.1 I have 2 tables with
With almost all of the (secure) WCF service endpoints in my application, if the
Using Spring 1.2.1 and oracle.jdbc.pool.OracleDataSource 10.2.0.3.0 I sometimes get a stack trace like below.
I know that join is not supported on client side with WCF DS thats
Why in a world I would get this (after hosting this wcf on my
I got a few WCFs that are running on an intranet on IIS 7.
I'm looking to create an Application Object Server that is sitting between Window form
I've seen some sites that use jQuery Animate to get their images to grow
Okay, I will shortly be starting down the path of windows mobile development. I
I have two profiles in my pom.xml, dev and stage: <profiles> <profile> <id>dev</id> <properties>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.