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.
1 Answer
What you can do
- Host WCF in ASP.NET compatibility mode
- Deny anonymous access to service uri in Web.Config
- 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