0

Claims used to have the following properties in .Net 4.5:

  • ClaimType: Gets the claim type of the claim.
  • Issuer: Gets the issuer of the claim.
  • OriginalIssuer: Gets the original issuer of the claim.
  • Properties: Gets the properties that are name-value pairs.
  • Subject: Gets the subject of the claim.
  • Value: Gets the value of the claim.
  • ValueType: Gets the value type of the claim.

It seems that there are new Claims now in .Net 4.6 with the following properties:

  • ClaimType: Gets the type of the claim.
  • DefaultComparer: Gets an object that can compare two Claim objects for equality.
  • Resource: Gets the resource with which this Claim object is associated.
  • Right: A string representation of a uniform resource identifier (URI) that specifies the right associated with this Claim object.
  • System: A pre-defined claim that represents the system entity.

Are they both just different representations of the same concept of claim in the concept of claims-based-identity?

Or the whole concept has changed?


To be more exact, I would like to consider the following authoriZation data:

  • UserData: UserId = "5";
  • ResourceData: ResourceName = "Book";
  • ActionData: ActionName = "ViewContents";
  • EnvironmentData: SystemLanguage = "English".

As far as I understand, this data can be represented by 4 different old-style claims. And this is clear for me how it's possible to create them.

How should this data be correctly represented by the new claims?

Thanks!

Andrey K.
  • 665
  • 8
  • 29

1 Answers1

0

I'm sorry for misleading question.

The first claim from the question (with 7 properties) is the new one. It exists since .Net 4.5. It is from System.Security.Claims namespace.

The second claim from the question (with 5 properties) is another claim, which exists since .Net 3.0. It is from System.IdentityModel.Claims namespace.

I think that what is needed for the situation in the question is the claim with 7 properties, the first one from System.Security.Claims.

EDIT: This answer is a good justification.

Community
  • 1
  • 1
Andrey K.
  • 665
  • 8
  • 29