views:

554

answers:

1

I am writing a console application to make calls to a wcf service that is hosted in iis and uses FormsAuthentication over SSL in production but not so in dev if possible.

I have the following link http://www.zamd.net/2009/03/05/FlowingFormsAuthenticationCookieToWCF.aspx and am looking for both the server and client configs as well as the code.

Are there any write ups anywhere that I can follow or sample apps i should be looking at?

A: 

Forms authentication is an ASP.net feature and there is no WCF setting for it. If you have a Form auth cookie in your console application, you can send it to WCF service from your console application. Forms authentication module, configured on your web site, will validate the cookie, populate the HTTPContext and processing continues. Now if your WCF service is running in ASP.net compat mode, you can access HttpContext from your WCF service and use it for authentication if you like. Above article explains how to send forms auth cookie as part of a WCF call.

I have talked about few other related scenarios in following posts (see part1 for background)

http://www.zamd.net/2009/04/25/FormsAuthFederatedSecurityPart2.aspx

Above post has complete source code with it as well.

hope that helps