Question

When working with Claims based identity with AspNet, in my case just using the templates coming with Visual studio 2013.

Taking the EntityFramework implementation of Microsoft.AspNet.Identity and looking at the User Model class.

Is it the intention that one put profile info into claims or to extend the user model with additional properties?

An example would be, I want to add a country associated with each user and edits the registration flow such user can give this information. Should I put this on the user or add it as a claim for that user.

Was it helpful?

Solution

To follow on from my comments, you want to put any user-specific settings (i.e. 1:1 relationship ) into the user table and not the claims table. That would apply to your profile settings

The claims table is per external claim. Although claims may contain duplicate values, they allow for the values (even name) to vary from site to site. It is after all only the value the user stated when they signed up to the external website.

There is also the facility to add additional separate tables, that relate to the user table, but probably not worth the extra effort for profile data.

*Note: there appear to be problems using database-first with asp.net identity, so you will likely need to make model-first changes and use database migration to update your database (which we wound up doing)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top