Allow API to look for other authentication mechanisms.
Allow logon code to be overridden
Merge pull request #573 from mapkyca/authentication-hooks

Authentication hooks