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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:59:03+00:00 2026-05-12T09:59:03+00:00

I have a WCF service deployed on another machine and I want to authenticate

  • 0

I have a WCF service deployed on another machine and I want to authenticate the client against the WCF service.

I have done the following things :

1) In IIS I have unchecked the Anonymous access and checked the “Integrated Windows Authenfication” check box.

2) My Web config

 <authentication mode="Windows" />
 <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBind">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

3) On the client side I am passing the user credential as below:

MyServiceClient _client;

_client = new MyServiceClient();

_client.ClientCredentials.Windows.ClientCredential.UserName = "username";
_client.ClientCredentials.Windows.ClientCredential.Password = "password";
_client.ClientCredentials.Windows.ClientCredential.Domain = "mydomain";

My question is how can I trap the user name and password on the server side (where the service is deployed)?

How can I authenticate user against the credential passed?

Currently I am using basichttp binding .. is this binding good enough to support security model?

  • 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-12T09:59:04+00:00Added an answer on May 12, 2026 at 9:59 am

    On the server side, you can either authenticate against Active Directory using Windows credentials being passed in, or then you’ll need to use an alternate store to handle user authentication.

    You can access the caller’s identity in your server side code using:

    IIdentity caller = ServiceSecurityContext.Current.PrimaryIdentity;
    

    You can also check whether a Windows user called with its Windows credentials (as in your sample) by checking the

    ServiceSecurityContext.Current.WindowsIdentity
    

    If it’s NULL, then no Windows credentials have been passed – otherwise you can use this Windows identity to check who is calling (name etc.) – you won’t be able to read the user’s password, though! You can check his name, what groups he belongs to, and more.

    To use Windows/Active Directory validation, set the clientCredentialType to “Windows”. You might have to switch to wsHttpBinding, or even better: netTcpBinding (if you’re on a Windows LAN behind a firewall).

    <bindings>
      <netTcpBinding>
        <binding name="WindowsSecured">
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    

    With this, only users who are registered in your Windows domain can even call the service. Any other users will be refused without any additional work on your side.

    Once you have the Windows user calling, you can check out the ServiceSecurityContext.Current.WindowsIdentity for information about who’s calling.

    Check the MSDN docs for details on what’s available on the service security context, or the Windows identity.

    Marc

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

Sidebar

Related Questions

I have a WCF service and I want to expose it as both a
I have a WCF service running on the IIS with a ServiceHostFactory. It's running
I have a WCF service, hosted in IIS 7.0 that needs to run database
I have a WCF service with the following configuration: <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=MetadataEnabled>
I have a WCF service which will be hosted under IIS. Now I have
We have a WCF service that is deployed to two servers. The bits are
I have a WCF service that I have to reference from a .net 2.0
I have a WCF service hosted for internal clients - we have control of
I have a WCF Service that should not enter the faulted state. If there's
I have a WCF service that is hosted in a windows application. The service

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.