user171523
user171523

Reputation: 4365

ASP.NET with WCF Windows Authentication

We have ASP.NET application which uses Windows integrated authentication. We would like to use the same windows authentication with our WCF service. Our ASP.NET is using the Windows Kerobros authentication. Is there any way we can leverage the same windows token for WCF service atuthitication.

Is it like configure the WCF with windows authenication and the same groups configure their. I would like to do something like Single Sign On type of implementation.

i am assumeing it will be like impersionation the current user and call the WCF call.

Upvotes: 0

Views: 1092

Answers (2)

Afazal
Afazal

Reputation: 542

Here is the sample code which will help you.
Code will wile take the windows authentication token from ASP.Net application and pass to the WCF service:


ServiceReference1.Service1Client _testserviceclient = new ServiceReference1.Service1Client();
_testserviceclient.ClientCredentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;

Upvotes: 0

Brad Christie
Brad Christie

Reputation: 101614

If I'm understanding you correctly (and please excuse me if I don't, it's getting late by my count), you should be able to play with enabling Windows authentication on WCF then configure your client to pass the credentials on:

  • system.serviceModel
    • behaviors
      • endpointBehaviors
        • behavior
          • clientCredentials
            • windows

And set the allowedImpersonationLevel attribute to Delegation or Impersonation (depending your needs) [see also]

...or I'm off base (In which case it's time for me to go to bed. My apologies & feel free to ignore this answer)

Upvotes: 2

Related Questions