what are the URLs for in claim-types

旧城冷巷雨未停 提交于 2019-12-01 05:19:58

These are ClaimTypes, which represents the pre-defined types of claims that an entity can claim. The ones you mention are from WIF, here are the IdentityModel ClaimTypes.

Known claimtypes are automatically deserialized into the context. Like http://schemas.microsoft.com/ws/2008/06/identity/claims/role is added as role to the user.roles collection (used for IsInRole).

So the types are not random, but by specification. You can add your own types. This can be any string, but you can also use the same format.

Suppose you add a CustomerId as claim, then you'll need to query the Claims collection by claimtype="CustomerId", or the uri you defined (like http://schemas.mycompany.com/2017/06/identity/CustomerId).

You can add claims by code, or by inserting records in the Identity.Claims tables.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!