This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4k
Make it easier to change the IsActiveAsync bahavior #3434
Labels
Comments
Btw, my use case would be: Task<bool> async CustomIsActivePredicate(user: ApplicationUser) =>
user != null && !await UserManager.IsLockedOutAsync(user) |
Just have the same problem when overriding |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
How about something like this: |
PR submitted. please have a look. |
leastprivilege
pushed a commit
that referenced
this issue
Mar 31, 2020
* update host to latest config * make profile service more extensible #3434 * cleanup
merged? yay! |
@brockallen Finally found time to upgrade to IS4 4.0 and it works great. Many thanks! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is your feature request related to a problem? Please describe.
The current
ProfileService.IsActiveAsync()
API:IdentityServer4/src/AspNetIdentity/src/ProfileService.cs
Lines 95 to 107 in 4b84868
To extend checks on the user-object one must either override the complete method including the null-checking and logging code or call the base method and load the user again (calling
UserManager.FindByIdAsync
which hits the database).Describe the solution you'd like
Please separate the data loading / logging code from the check-predicate.
For example: Extract the
context.IsActive = user != null
line (106) into a protected virtual member which can be overridden in a derived class. (+ allow it to be "async")Maybe better extract a boolean-returing predicate (only the
user != null
part, not thecontext.IsActive = ...
part).The text was updated successfully, but these errors were encountered: