MR.ABC
MR.ABC

Reputation: 4862

WCF Authentication with Javascript

I like to secure a wcf service, without passing username password every single call from javascript. I think i can realize it with cookies ? I'm not sure where to start. I like to see code to understand, its says more than words. There are many examples how to make a authentication with .NET, but i'm not sure how the work with relation to javscript.

Upvotes: 1

Views: 128

Answers (1)

parapura rajkumar
parapura rajkumar

Reputation: 24403

What you can do

  1. Host WCF in ASP.NET compatibility mode
  2. Deny anonymous access to service uri in Web.Config
  3. Implement forms authentication on your web site

Step 1 and 2 will ensure that anonymous access is not granted to WCF service. Step 3 will ensure that with javascript requests any authentication cookies are automatically passed

Upvotes: 1

Related Questions