|
|||||
|
IEntityLoginManager Serialization Issues |
Post Reply
|
| Author | |
midnit
Newbie
Joined: Jun-22-2009 Location: Charlotte Posts: 23 |
Post Options
Quote Reply
Topic: IEntityLoginManager Serialization IssuesPosted: Jul-02-2010 at 9:39am |
|
We are working on upgrading to DevForce 2010. Our IEntityLoginManager worked fine in 2009 and I expect is not the issue here but I am at a loss at what IS causing the issue. Please advise.
"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ideablade.com/EntityModel:LoginResult. The InnerException message was 'Element 'http://ideablade.com/EntityModel:Principal' contains data of the 'http://schemas.datacontract.org/2004/07/System.Security.Principal:GenericPrincipal' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'GenericPrincipal' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details."
|
|
![]() |
|
ting
IdeaBlade Joined: Mar-27-2009 Location: San Francisco Posts: 332 |
Post Options
Quote Reply
Posted: Jul-02-2010 at 8:26pm |
|
We made a change to the IEntityLoginManager in DevForce 2010 (this was buried on page 28 of the Release Notes). You should now be returning a UserBase or your own IPrincipal. As Kim writes below, GenericPrincipal and GenericIdentity are not native to Silverlight and we no longer define them. If you subclass from UserBase make sure to mark any properties you need on the client with the [DataMember] attribute so they will serialize.
If you implement your own IPrinicpal, you can make it serializable by doing the following:
Edited by ting - Jul-09-2010 at 5:19pm |
|
![]() |
|
kimj
IdeaBlade Joined: May-09-2007 Posts: 654 |
Post Options
Quote Reply
Posted: Jul-04-2010 at 6:01pm |
|
GenericPrincipal and GenericIdentity are not types intrinsic to Silverlight. In DevForce Silverlight 2009 we did define these types within the DF assemblies, but we dropped this in DF 2010. (GenericPrincipal and GenericIdentity are still available in standard .NET - http://msdn.microsoft.com/en-us/library/system.security.principal.genericprincipal.aspx.)
You can return any type implementing IPrincipal from an IEntityLoginManager, as long as it's defined on both client and server.
|
|
![]() |
|
mlens
Newbie
Joined: Apr-19-2010 Location: Australia Posts: 7 |
Post Options
Quote Reply
Posted: Jul-29-2010 at 5:23pm |
|
Any chance you could post a sample implementation of the LoginManager under DevForce 2010? It's really confusing when you say GenericPrincipal and GenericIdentity are no longer supported but the login method of IEntityLoginManager returns IPrincipal....
Thanks |
|
![]() |
|
kimj
IdeaBlade Joined: May-09-2007 Posts: 654 |
Post Options
Quote Reply
Posted: Jul-30-2010 at 10:30am |
|
There's a snippet here, along with more information -
http://www.ideablade.com:8989/xwiki/bin/view/Documentation/Security#HImplementingIEntityLoginManager
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |