Last post Apr 18, 2014 11:29 AM by panand
Apr 04, 2014 12:33 AM|panand|LINK
Is there some way that i could implement the IUserPasswordStore interface and extend the capabilities of the default Identity provider?
I know that a complete custom implementation can resolve the problem, but I am not sure if I will ever get approval to do it, or use a third-party provider.
Thanks for your help!
Apr 04, 2014 09:22 AM|BrockAllen|LINK
Sure, but it's somewhat a pain. What problem are you trying to overcome?
Apr 04, 2014 11:48 AM|panand|LINK
I am trying to implement PasswordExpiry validation
Example: When user changes passwords, a password used in the last 90 days cannot be reused
Password Lock Out policy - User is locked out after 3 failed login attempts
Apr 04, 2014 11:55 AM|BrockAllen|LINK
The lockout is built-in (sort of) in v2. But if you're still on v1, then yea, you'll have to do it yourself.
Here's some sample code that shows what this might look like:
Make sure you look at the v1 branch.
Apr 04, 2014 08:45 PM|panand|LINK
Thanks Brock! I will go through this code in detail. My Friday was gone in finding solution to a related problem, and I will present it here .
The issue is related to implementing the FindASync method of IUserLoginStore.
Here is a code snippet. I may be doing this completely wrong, or I'm not seeing the obvious. Sorry about the bold texting, but it looks like this editor does not have any coloring options.
Task<ApplicationUser> IUserLoginStore<ApplicationUser>.FindASync(UserLoginInfo login)
var user =userStore.FindAsync(login); //userStore is my cusom implementation of UserStore
// This method returns successfully confirming that a Google Login is found in the AppUserLogin table and the
return type is Task<IdentityUser>
// However, the return type of FindASync is
Task<ApplicationUser>. As a result, my return type fails!
//ApplicationUser implements the IdentityUser Interface
//What am I missing?
Apr 04, 2014 09:09 PM|BrockAllen|LINK
The async and await keywords, perhaps?
Apr 05, 2014 12:47 PM|panand|LINK
Yep! that was the problem!
I failed to notice that the FindAsync method call was awaitable in the controller Login action.
Now on to the Lockout research!...
Apr 18, 2014 11:29 AM|panand|LINK
Brock, I have to add this to our application somewhere down the line. As of now, our options are limited to registering users by converting the registration functions to an Admin management function. Therefore, the password reset functionality is not really
at the top of anyones list right now (i know! but business realities trump technical enthusiasm!)
Also, an internal preview of the prototype application lead to an overwhelming vote to push for authentication against active directory.
I have since integrated active directory authentication with the Identity system, and users get registered with an External Login.
Thanks for your help with this.