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 548455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:04:50+00:00 2026-05-13T11:04:50+00:00

I am trying to authenticate calls to a WCF DataServices service via Silverlight. Essentially,

  • 0

I am trying to authenticate calls to a WCF DataServices service via Silverlight. Essentially, when a user logs in they get a special hash which should be embedded in the headers of every request to the WCF DataServices. Currently use this as a check via a QueryInterceptor method eg

    [QueryInterceptor("Orders")]
    public Expression<Func<Orders,bool>> OnQueryOrders()
    {
        string hash = WebOperationContext.Current.IncomingRequest.Headers.Get("MyHeader");

        if(!TestHash(hash))
        {
            return o => false;
        }
        else
        {
            return o => true;
        }
    }

This seems like the WORST way to achieve this. Is there any hook in WCF Dataservices the runs before a query is run that you can use to cancel a request? Bear in mind this service is stateless and has no access to session.

  • 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-05-13T11:04:50+00:00Added an answer on May 13, 2026 at 11:04 am

    Actually I think I resolved this issue myself. By overriding the OnStartProcessingRequest I can throw an exception if it doesn’t suit e.g.

        protected override void OnStartProcessingRequest(ProcessRequestArgs args)
        {
            if (string.IsNullOrEmpty(WebOperationContext.Current.IncomingRequest.Headers.Get("MyMagicHeader")))
            {
                throw new DataServiceException(404, "Access denied!");
            }
            else
            {
                base.OnStartProcessingRequest(args);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying authenticate user in Spring Security application via oAuth. I'm already received token
I'm trying go get WCF server and client mutually authenticate each other using SSL
Am trying to authenticate a soap webservice, but the SHA1 hash that I produce
I'm trying to authenticate user accounts in Windows Phone. I found this C# library
I'm trying to authenticate a user through the RESTful API (not Connect) but I
I'm trying to authenticate to YouTube via their Data API and simply need to
I'm doing FormsAuthentivcation, on a Silverlight app. When the SL app calls a WCF
I'm trying to get the current user's favorite artists. When I use the '/me/music'
I'm trying to authenticate a user against Active Directory using the types in the
I'm trying to test web service calls using an ASP.NET page that creates a

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.