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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:40:43+00:00 2026-05-23T23:40:43+00:00

Is there a way to pass domain credentials from the originating browser in webHttpBinding

  • 0

Is there a way to pass domain credentials from the originating browser in webHttpBinding WCF service?
I’m thinking this should be possible as when I log into any aspx page with Windows Authentication enabled in IIS, I can get the calling user’s domain credentials. How would I setup my WCF service in such a manner? Currently the user identity I get in the WCF service are those of the app pool the svc is running under?

EDIT

I don’t have .NET 4 — My configuration file is below, but I still get an error:

Security settings for this service require ‘Anonymous’ Authentication
but it is not enabled for the IIS application that hosts this service.

Should I explicitly enable Anonymous for that path in IIS? I think this would undo my efforts to get the domain name.

<behaviors>
<endpointBehaviors>
    <behavior name="Awesome.Project.OperationsBehavior">
        <enableWebScript />
    </behavior>
</endpointBehaviors>
</serviceBehaviors>
    <behavior name="Awesome.Project.OperationsServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
</serviceBehaviors>
</behaviors>

<services>
      <service behaviorConfiguration="Awesome.Project.OperationsServiceBehavior"
        name="Awesome.Project.Operations">
        <endpoint address="" binding="webHttpBinding" 
         contract="Awesome.Project.Operations" 
         behaviorConfiguration="Awesome.Project.OperationsBehavior" 
         bindingName="windowsSecurityWebHttpBinding">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <!--<endpoint address="mex" binding="mexHttpBinding" 
             contract="IMetadataExchange" />-->
      </service>
</services>

<bindings>
    <webHttpBinding>
        <binding name="windowsSecurityWebHttpBinding">
            <security mode="Transport">
                <transport clientCredentialType="Windows"/>
            </security>
        </binding>
    </webHttpBinding>
</bindings>
  • 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-23T23:40:44+00:00Added an answer on May 23, 2026 at 11:40 pm

    You need to turn on authentication in the service – assuming .NET 4 add the following to your config

    <bindings>
      <webHttpBinding>
        <binding>
          <security mode="Transport">
            <transport clientCredentialType="Windows"/>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    

    for .NET 3.5 or 3.0 you need

    <bindings>
      <webHttpBinding>
        <binding name="webBindingConfig">
          <security mode="Transport">
            <transport clientCredentialType="Windows"/>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    
    <services>
      <service ...>
        <endpoint bindingConfiguration = "webBindingConfig" binding="webHttpBinding" .../>
      </service>
    </services>
    

    Edit for additional questions:

    WCF will generally not pass credentials over non secured transports – that’s why mode=”Transport” is important. If you got rid of it its the same as Mode=”None” for WebHttpBinding

    If the site is considered to be in the intranet zone then IE will pass the user’s credentials automatically. However, non-IE browsers will not and so will hit the site anonymously before getting a 401 and then sending the credentials. The intial request requires anonymous access to be supported in IIS as WCF handles the authentication mechanism

    If you need to get hold of HttpContext you can use Asp.NET Compatibility. However in WCF you can use ServiceSecurityContext.Current.PrimaryIdentity.Name to get the authenticated user

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

Sidebar

Related Questions

Is there any way to pass a callback to java code, from C. And
Is there a way to pass null arguments to C# methods (something like null
Is there a way to pass a call back function in a Java method?
Is there a way to pass a start time via URL when opening a
Is there any way to pass HTTP AUTH username and password along with an
Is there any way to pass command line parameters to a Flash projector in
Is there a way to pass foo_ around outside of main? I saw something
Is there a way to pass a variable into a regex in jQuery/Javascript? I
Is there a way to pass a class into a property as a Class
I am wondering if there is a way to pass a variable to 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.