-
Notifications
You must be signed in to change notification settings - Fork 865
Expose internals of UserManager and UserStore functions and properties to help implementors #596
Comments
Happy to submit a pull request if you want me to do the leg work |
Further more this will allow per-user PasswordHashing, as at the moment it's a one size fits all. Say I want to increase the number of iterations for password hashing over time ( as hardware power increases ). I would need to store the number of iterations last used, read that off the user record and verify the password with that number of iterations. If the number of iterations is lower than currently configured, rehash the password and store the updated information |
Sure. Please send a PR so we can look at all places where you need this. |
Had a first cut, but I'm getting errors doing a package restore in the IdentitySample.MVC project, and also getting a exception from DNX when discovering tests. I can't verify any of my changes apart from a compile. Any ideas on what is wrong ? I have Installed Beta8 tooling and runtime DNX Core 5.0 References NotFound https://api.nuget.org/v3-flatcontainer/microsoft.extensions.optionsmodel/index.json 994ms ------ Test started: Project: Microsoft.AspNet.Identity.EntityFramework.InMemory.Test ------ System.NullReferenceException: Object reference not set to an instance of an object. |
I have the follow changeset in my fork you can look at |
I am also caught up here in looking at implementing a custom UserManager in order to extend and the fact that If these methods were made protected, then extending UserManager would be much easier to create functions that follow common patterns that exist in UserManager Code |
@bprentice, I'm on a similar situation where I have a Tenant discovered at Middleware stage (with its One choice, seems to be extending and injecting custom UserManager, UserStore, SignInManager. But as it is (lots of privates), seems really anti-DRY. Did you continue digging on a solution for this? Found any? |
Done as part of #798 |
As I extended aspects of the UserManager and UserStore object I keep having to re-implement private functions. Can you please make all private ( and maybe internal ) functions and properties available to protected scope as well.
i.e.
UserManager<TUser>.CancellationToken { get; }
UserManager<TUser>.GetClaimStore()
UserManager<TUser>.UpdateSecurityStampInternal(TUser)
UserManager<TUser>.ThrowIfDisposed()
UserStore<TUser, TRole, TContext, TKey>.SaveChanges(CancellationToken)
UserStore<TUser, TRole, TContext, TKey>.ThrowIfDisposed()
I can't really see any reason to hide this stuff from sub classes and just makes life easier.
The private static NewSecurityStamp() function is ONLY accessed from an instance function, as as it is static it cannot be replaced ( ie with a cryptographically security implementation - it is used to create tokens after all ). Please make it protected virtual.
The text was updated successfully, but these errors were encountered: