WCF consumed by {JSON + ASP.NET} - Authentication, form or Windows?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: WCF consumed by {JSON + ASP.NET} - Authentication, form or Windows?

Hybrid View

  1. #1
    Join Date
    Feb 2001

    WCF consumed by {JSON + ASP.NET} - Authentication, form or Windows?


    I have a WCF service to be consumed by both:

    Consumer #1
    ASP.NET - ASP.NET app uses form-authentication and impersonate a Windows user account WEBUSER. This is a web user account but by and large it works fine as the intention is to tighten the security. So ...

    web.config of the ASP.NET app:
    <authentication mode="Forms">
    path="/" />
    <identity impersonate="true"
    password="SomeSecret" />
    And in web.config of WCF Service hosted in IIS:

    <authentication mode="Windows"/>
    Works fine.

    Consumer #2 JSON/AJAX all from web page in ASP.NET (Consumer #1)

    Now, I added webpage to ASP.NET app that makes AJAX/JSON calls to the WCF Service. I'm not sure what to do in web.config of my WCF Service . Clients viewing the webpage are not always domain users (and we wouldn't want to tie down to this model anyway).

    FYI, in WCF web.config, I've added:
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <endpoint address="JSON" behaviorConfiguration="JSONBehavior"
    binding="webHttpBinding" bindingConfiguration="" name="JSON"
    contract="xxx.SecurityServiceLib.ISecurityService" />
    <behavior name="JSONBehavior">
    <enableWebScript />
    I suppose this would suffice for AJAX post/get to include forms-authentication cookie when invoke WCF right?

    Any suggestion? Thanks!
    Last edited by THY02K; May 20th, 2009 at 04:47 AM.

  2. #2
    Join Date
    Oct 2008

    Re: WCF consumed by {JSON + ASP.NET} - Authentication, form or Windows?

    There is a ton of training for JSON, AJAX, and WCF that you can take advantage of for free.

    GO to http://www.codeguru.com/forum/showth...56#post1896756 and type JSON into the search box .

    You can also try, http://www.msdev.com/ and type the same search term in to see what trainings are available there.

    Hope this helps,


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a Codeguru.com survey!

HTML5 Development Center