New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate having CslaPrincipal subclass ClaimsPrincipal #496

Closed
rockfordlhotka opened this Issue Nov 10, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@rockfordlhotka
Member

rockfordlhotka commented Nov 10, 2015

As per this discussion: MarimerLLC/cslaforum#91

The two major considerations I can see right now are whether ClaimsPrincipal/ClaimsIdentity exists across all the platforms supported by CSLA, and whether it will be possible to implement IMobileObject over the Microsoft types.

@rockfordlhotka rockfordlhotka added this to the Backlog milestone Nov 10, 2015

@dazinator

This comment has been minimized.

Show comment
Hide comment
@dazinator

dazinator Jan 24, 2017

Member

There is a NuGet package for claims, which supports netstandard 1.3 and most platforms, however for full .NET it requires .NET 4.6.

Prior to .net 4.6, the claims types appear to be in mscorlib - for example for .net 452: // C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\mscorlib.dll

whether ClaimsPrincipal/ClaimsIdentity exists across all the platforms supported by CSLA

Based on the above, a quick glance suggests that they do, but depending on what version of the platform you want to support, the types may have been moved around, so you might have to do some cross compilation.

I think this would be a lot easier to achieve in the future, if most CSLA projects were moved to netstandard.
I did see you had some work around netstandard but appreciate that would be a pretty grand change.

Member

dazinator commented Jan 24, 2017

There is a NuGet package for claims, which supports netstandard 1.3 and most platforms, however for full .NET it requires .NET 4.6.

Prior to .net 4.6, the claims types appear to be in mscorlib - for example for .net 452: // C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\mscorlib.dll

whether ClaimsPrincipal/ClaimsIdentity exists across all the platforms supported by CSLA

Based on the above, a quick glance suggests that they do, but depending on what version of the platform you want to support, the types may have been moved around, so you might have to do some cross compilation.

I think this would be a lot easier to achieve in the future, if most CSLA projects were moved to netstandard.
I did see you had some work around netstandard but appreciate that would be a pretty grand change.

@rockfordlhotka

This comment has been minimized.

Show comment
Hide comment
@rockfordlhotka

rockfordlhotka Oct 9, 2017

Member

The solution I've settled on is to do the following:

  1. Implement Csla.Security.CslaClaimsPrincipal as a simple wrapper around the normal ClaimsPrincipal so it implements IMobileObject (otherwise it can't be serialized via MobileFormatter).
  2. Add special case code to MobileFormatter to handle the new CslaClaimsPrincipal type; necessary because deserialization must be handled via the constructor, it isn't possible to create the object then initialize, it must be created by passing in a binary stream to the ctor.

The result of this work is that anyone needing to use ClaimsPrincipal and CSLA can use CslaClaimsPrincipal and it should work universally.

Member

rockfordlhotka commented Oct 9, 2017

The solution I've settled on is to do the following:

  1. Implement Csla.Security.CslaClaimsPrincipal as a simple wrapper around the normal ClaimsPrincipal so it implements IMobileObject (otherwise it can't be serialized via MobileFormatter).
  2. Add special case code to MobileFormatter to handle the new CslaClaimsPrincipal type; necessary because deserialization must be handled via the constructor, it isn't possible to create the object then initialize, it must be created by passing in a binary stream to the ctor.

The result of this work is that anyone needing to use ClaimsPrincipal and CSLA can use CslaClaimsPrincipal and it should work universally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment