cslaforum icon indicating copy to clipboard operation
cslaforum copied to clipboard

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

Open SachinPNikam opened this issue 5 years ago • 2 comments

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

SachinPNikam avatar Apr 29 '20 10:04 SachinPNikam

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.

rockfordlhotka avatar Apr 29 '20 19:04 rockfordlhotka

Thanks Rocky for quick ,valuable reply .

SachinPNikam avatar Apr 30 '20 07:04 SachinPNikam