WCF Authorization

WCF Authorization

Old forum URL: forums.lhotka.net/forums/t/4967.aspx


Alexanderdt posted on Thursday, June 12, 2008

Hi Rocky,

I am fairly new to wcf, I have been trying to get this WCF up and running with my BusinessObjects Class where I do a Normal call "Products productList = Products.GetProducts();".
I have set the "CslaDataPortalProxy" to "Csla.DataPortalClient.WcfProxy, Csla" and I am able to call my BusinessObject as Normal through the Wcf service. I have a problem with the Authorization though,
when i set the <add key="CslaAuthentication" value="Csla" /> I get an error: "DataPortal.Fetch failed (Principal must be of type BusinessPrincipal, not System.Security.Principal.GenericPrincipal)"
So I set it to use Windows Authentication and that works 100%, but now I want to use this WCF service over the network and if I leave the Authentication on Windows I get an error: "The caller was not authenticated by the service."

Any form of help would be appreciated.

RockfordLhotka replied on Thursday, June 12, 2008

If you want to use custom authentication you should read Chapter 12, or the CSLA .NET Version 2.1 Handbook for details. It is pretty easy, but you need to configure both client and server to use the same CSLA authentication mode.

If you want to use Windows authentication then you again must configure CSLA to use the same CSLA authentication mode on client and server. But you also must configure IIS, ASP.NET and/or WCF properly, so you get both authentication and impersonation.

http://www.codeplex.com/wcfsecurityguide should be helpful in this regard.

Alexanderdt replied on Friday, June 13, 2008

Thanx Rocky,

At the end I changed by binding to "basicHttpBinding" and it worked 100% over the Network. I couldn't get it up and running on "wsHttpBinding", but I will do some more investigation on how to get that right.

Alex

RockfordLhotka replied on Friday, June 13, 2008

Ha! I have done exactly the same thing a couple times – not having time in a given phase to fight with WCF, we backed off to basicHttpBinding and then allocated more time in a later phase to figure out the WCF configuration.

 

It just shouldn’t be that hard…

 

Rocky

 

 

From: Alexanderdt [mailto:cslanet@lhotka.net]
Sent: Friday, June 13, 2008 7:09 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] WCF Authorization

 

Thanx Rocky,

At the end I changed by binding to "basicHttpBinding" and it worked 100% over the Network. I couldn't get it up and running on "wsHttpBinding", but I will do some more investigation on how to get that right.

Alex


Copyright (c) Marimer LLC