I think, you are at the right place.
I think, you should look at the text-handler (test it first) and probably use this as a base for your own handler.
As you see in http://ez.no/developer/ez_publish_3/documentation/configuration/configuration/login_handler/using_text_file , the text handler also reads values from the .ini files. Of course, for accessing your own Databases (with your user data), you must write your own code.