JonPSmith / AuthPermissions.AspNetCore

This library provides extra authorization and multi-tenant features to an ASP.NET Core application.
https://www.thereformedprogrammer.net/finally-a-library-that-improves-role-authorization-in-asp-net-core/
MIT License
808 stars 161 forks source link

Using with identityuser type int #21

Closed Kiwiz777 closed 2 years ago

Kiwiz777 commented 2 years ago

hi there i am trying to use IndividualAccountsAuthentication which in my case class named AppUser inheriting from identity user class AppUser : IdentityUser<int> and i get an error / Error CS0311 The type 'RivaWeb.Models.AppUser' cannot be used as type parameter 'TCustomIdentityUser' in the generic type or method 'SetupExtensions.IndividualAccountsAuthentication(AuthSetupData)'. There is no implicit reference conversion from 'RivaWeb.Models.AppUser' to 'Microsoft.AspNetCore.Identity.IdentityUser' / is there something i am missing or there is no way i can use an int for the user id with this library.

JonPSmith commented 2 years ago

Hi @Kiwiz777

This library relies on a userId that is a string, so you can't have a IdentityUser<int>. Sorry, but that is limitation of the library