New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApiAuthorizationDbContext<TUser> force TUser to extends IdentityUser instead of IdentityUser<TKey> #9548
Comments
Part of the identity server support I believe. @javiercn ? |
ApiAuthorizationDbContext is just a convenience class for the templates. We don’t plan to support all the variants IdentityDbContext supports. If you want to customize the key you can extend IdentityDbContext directly and implement IPersistentGrantDbContext as ApiAuthorizationDbContext does. |
Re-opening, since
|
@javiercn Is this the correct repo to track this issue? If not, where should I move it? |
@ajcvickers This is the correct repo. Could we use a separate issue to track the items you mention? |
2020 Looks like it was not fixed yet... Am I wrong? |
@blowdart , @ajcvickers - Would you accept a PR from the community on this one? I have opened up #21100 that should hopefully address everything. Thanks for your consideration. |
We've decided not to support this |
The idea is that apps can derive from IdentityDbContext directly and utilize the generic support there, this class is just meant to be sugar for the most common scenario |
Describe the bug
At the moment,
ApiAuthorizationDbContext<TUser>
forceTUser
to extendsIdentityUser
instead ofIdentityUser<TKey>
. This means it is impossible to use Identity Server on application withApplicationUser : IdentityUser<Guid>
(or anything different fromIdentityUser<string>
)To Reproduce
Steps to reproduce the behavior:
IdentityUser<Guid>
instead ofIdentityUser
The type 'WebApplication.Models.ApplicationUser' cannot be used as type parameter 'TUser' in the generic type or method 'ApiAuthorizationDbContext<TUser>'. There is no implicit reference conversion from 'WebApplication.Models.ApplicationUser' to 'Microsoft.AspNetCore.Identity.IdentityUser'.
Expected behavior
I would expect
ApiAuthorizationDbContext
to accept another generic to indicate the key type (e.g.ApiAuthorizationDbContext<ApplicationUser, Guid>
)The text was updated successfully, but these errors were encountered: