Authentication being bypassed when calling dataportal

Authentication being bypassed when calling dataportal

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


nobby_trussin posted on Wednesday, January 20, 2010

Hi,

We have a problem whereby the security aspect of our Csla for Silverlight application does not seem to be setup correctly.

We can perform a fetch (and indeed all other actions) on our business objects before we have even logged in and set the Csla.ApplicationContext.User to an authenticated principal. Interestingly, after we log in, we cannot perform any actions - we receive a "No parameterless contructor defined for this object".

I'm sure we're just missing something simple somewhere. We have tried setting both the CslaAuthentication appsetting AND the AuthenticationType property on the Identity object to "Csla" but to no avail.

Has anyone else encountered anything like this?

Thanks for your help

Dan

sergeyb replied on Wednesday, January 20, 2010

All Silverlight CSLA classes must have public constructor defined. I am guessing this is what you are running into.

Sergey Barskiy
Principal Consultant
office: 678.405.0687 | mobile: 404.388.1899

Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

-----Original Message-----
From: nobby_trussin [mailto:cslanet@lhotka.net]
Sent: Wednesday, January 20, 2010 11:33 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Authentication being bypassed when calling dataportal

Hi,

We have a problem whereby the security aspect of our Csla for Silverlight application does not seem to be setup correctly.

We can perform a fetch (and indeed all other actions) on our business objects before we have even logged in and set the Csla.ApplicationContext.User to an authenticated principal. Interestingly, after we log in, we cannot perform any actions - we receive a "No parameterless contructor defined for this object".

I'm sure we're just missing something simple somewhere. We have tried setting both the CslaAuthentication appsetting AND the AuthenticationType property on the Identity object to "Csla" but to no avail.

Has anyone else encountered anything like this?

Thanks for your help

Dan

nobby_trussin replied on Thursday, January 21, 2010

Hi,

Thanks for your reply. I forgot to mention that all my Silverlight classes do have public constructors. Presumably they are setup correctly as I can fetch/update/create the objects before I have logged in, but not after.

Cheers

Dan

JonnyBee replied on Thursday, January 21, 2010

Hi,

How about the principal and identity objects?

I presume you are using custom principal/identity and it seems like there is a serialization error on these. They should inherit from Csla.Security.BusinessPrincipalBase and Csla.Security.CslaIdentityBase.

 How are they defined in your app?

nobby_trussin replied on Wednesday, January 27, 2010

Hi,

Sorry for late reply. The principal and identity are defined as you mentioned above.

Thanks

Dan

nobby_trussin replied on Wednesday, January 27, 2010

Problem is now sorted. I WAS missing a constructor after all - it was the private constructor on the Principal object I was missing.

Thanks to everyone for replying

Dan

Copyright (c) Marimer LLC