Identity: ASP.NET Identity 3 without Roles and using only Claims

Created on 5 Oct 2015  路  12Comments  路  Source: aspnet/Identity

Hello,

Is it possible to use ASP.NET Identity 3 in a MVC project only with Claims table and without Roles table?

I am asking this because Role is itself a Claim of type Role so isn't it redundant to have a Roles table?

Thank You

duplicate enhancement

Most helpful comment

We should revisit this and see if this is something we want to do in 1.2

All 12 comments

spot on ;p

@blowdart @HaoK @rustd

In a ASP.net Identity on ASP.net MVC 5 is fully possible. In MVC 6 I guess, yes!

IMHO:

1 - Using only roles and having one roles table;
In this case there would be the RolesStore ...

2 - Using claims, including roles, and having only one claims table.
In this case there would be the ClaimsStore ... Role is a Claim of type Role.

If this results in unwanted complexity why not having only one Claims table and if configuration includes only Roles then Claims table would allow only claims of type Role ...

I just think that having Roles and Claims tables when a Role is a Claim does not make sense.

@alexsandro-xpt:

Do you know where can I find an example of how to set ASP.NET Identity only with Claims?

I was looking and didn't find it ... I just found info on how to add claims on top of roles.

Better documentation for ASP.NET Identity would be great ...
And it would even help people to give better feedback ...

:+1:

Moving to RC2 so we can look into it soon.

Any change this to be available on RC2?

Is their any update on this issue?

We should revisit this and see if this is something we want to do in 1.2

Is there a chance you can add an overload to the extension method AddIdentity so that you can write:

services.AddIdentity<AppUser>
    .AddEntityFrameworkStores<AppUserCtx>()
    .AddDefaultTokenProviders();

This of course, while you convince yourselves that it is better to roll with Claims only and eliminate the redundancy of Roles.

Yup we plan on doing this for 2.0, tracked via https://github.com/aspnet/Identity/issues/1269

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hikalkan picture hikalkan  路  6Comments

danroth27 picture danroth27  路  4Comments

PaulRReynolds picture PaulRReynolds  路  4Comments

VR-Architect picture VR-Architect  路  6Comments

mmgafri picture mmgafri  路  3Comments