MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

how to convert Csla.ApplicationContext.User to SLMPrincipal class ? #944

Open SachinPNikam opened 4 years ago

SachinPNikam commented 4 years ago

Question I have public class SLMPrincipal : Csla.Security.CslaClaimsPrincipal --BO

I did login after I want get the Csla.ApplicationContext.User back to the SLMPrincipal

below code is not working getting error like can not convert claim principal to SLMPrincipal

(SLMPrincipal)Csla.ApplicationContext.User

Version and Platform CSLA version: 5.1.0 Platform-.NetCore 3.0

rockfordlhotka commented 4 years ago

Microsoft has been aggressive in pushing us all to use ClaimsPrincipal and ClaimsIdentity. To the point that they'll often silently switch a custom principal type to a ClaimsPrincipal "for you".

As a result, I'm moving ProjectTracker and all other samples to use those two types and not to try and use any custom types. Custom types are just problematic.

Starting in version 5.1 the MobileFormatter includes functionality to serialize the (otherwise not serializable) claims types, providing you with a seamless experience.

SachinPNikam commented 4 years ago

Thanks Rocky for quick ,valuable reply .