質問

I am trying to build a claims aware Application using MembershipReboot library for authentication Thinktecture.IdentityModel.45 for authorization. As far as tutorials go, they are all adding Claims manually to the "UserClaims" Table (not sure which library added that), which contains the UserID, the Type of the Claim and the Value. I would like to add the claims programmatically to this table, but I am not sure how to do this in a obvious way.

役に立ちましたか?

解決

You can add/remove claims via the AddClaim/RemoveClaim API on the UserAccount class. See the SingleTenantWebApp sample for an example:

https://github.com/brockallen/BrockAllen.MembershipReboot/blob/master/samples/SingleTenant/SingleTenantWebApp/Areas/UserAccount/Controllers/HomeController.cs#L28

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top