Fix _get_login for new upstream API

The changeset c9be44cd05e1 modifies the returned values of _get_login.

issue3975
review6411002
Don't catch all Exception

- add some logging
- fail properly when more than 1 user is found
- add unittest

review6411002