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

  • Home
  • SEARCH
  • 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 59707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:02:51+00:00 2026-05-10T18:02:51+00:00

All of this is pertaining to WebHttp binding, hosted in a custom Service Host

  • 0

All of this is pertaining to WebHttp binding, hosted in a custom Service Host (IIS is not an option at this time).

I’ve implemented a custom UserNamePasswordValidator, and a custom IAuthorizationPolicy. When I configure the endpoint’s binding to use Basic authentication, everything works just as I’d like (custom principal, custom roles, etc..).

I’d like to add the ability for anonymous HTTP access as well, and have my custom implementations put the Anonymous user in some default roles, etc.. (if no Authenticate header is sent).

What happens now is that anonymous users are given a 401 before any of my custom code is hit. If I turn off the HTTP Basic authentication requirement, then the Authenticate header is ignored altogether.

How do I configure, or inject an Authenticate header, to do this both ways (without creating 2 separate endpoints)?

  • 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. 2026-05-10T18:02:51+00:00Added an answer on May 10, 2026 at 6:02 pm

    First of all, the service responds correctly to the anonymous call, according to the specification.

    Second, this is impossible. When you are self-hosting your service and you have some http binding, WCF will use a System.Net.HttpListener instance to be able to respond to http requests (created in System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen). This listener has a method called HandleAuthentication that is called way before any of your custom code is called. It is responsible for sending back the 401 response with the challenge (WWW-Authenticate). There is nothing you can do about this. If there is, I’d like to know.

    So you’re left with the following options:

    • two endpoints
    • configure your clients to know the default credentials
    • change your clients so they can respond to the challenge
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Cheat. Expose this process as another WCF service and fire… May 11, 2026 at 11:12 am
  • added an answer I don't know what is available in PL/SQL, but T-SQL… May 11, 2026 at 11:12 am
  • added an answer You should use System.Web.HttpUtility.UrlDecode not Encoding.ASCII to peform the decoding.… May 11, 2026 at 11:12 am

Related Questions

All of this is pertaining to WebHttp binding, hosted in a custom Service Host
I think this is a multi-part question, so bear with me. Currently all of
First of all (in case this is important) I'm using ActiveState's Perl (v5.8.7 built
This is going to be the noobist of all noob questions, but what exactly
Okay this is not a question of how to get all uniques or How
What is the purpose of this Rails config setting... config.action_controller.consider_all_requests_local = true It's set
First of all there is a partial question regarding this, but it is not
im re-factoring php on zend code and all the code is full of $_GET[this]
Bit of an obscure one this. My setup is all running on my local
All of a sudden in this MVC site I have no views that can

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.