I am working on implementing a custom membership provider that works against an existing schema in my database and has a few thoughts / questions.
The login control will automatically output the ValidateUser method of the membership provider, so no matter how I implement the provider, the only thing that monitors login control is the bool value returned by this method. What confuses me may be many reasons why the login attempt failed; user is blocked, too many attempts for a certain period of time, etc. I see no way to pass this to the control so that it can display the correct message. Other membership provider properties, such as PasswordStrengthRegularExpression, have absolutely no effect on login control (out of the box), I would hope that it will automatically convert to regular expression validators in some way, but that doesn't seem to be the case. Therefore, it seems to me that I need to initialize the login control properties with these settings from the provider configuration if I want them to take the control itself.
If the only thing the Login control does out of the box (without manually processing events and initializing, as described above), calls the ValidateUser method of the membership provider, I see no way to return to the Login control why the validation failed or even did something like throttling validation requests based on a specific time window. Ultimately, my question is, why would I even use a membership provider, and then combined with login controls? It seems like it was designed only for a yes / no answer, which is very restrictive. If I want to build logic with different messages back to the user, I need to process the input control events and call my own authentication classes that will handle all my business requirements, and also return a custom error message back to the Login control for the user so that they knew why their attempt was invalid.
If I'm not mistaken in my assumptions, it seems that the interface between the Login control as a membership API is too restrictive to be useful. The API may work better for other out-of-control controls, such as ChangePassword, but for the actual login I donโt see the point.
I appreciate your thoughts.
e36M3
source share