Configurable authentication lookup

vumi doesn't have any tests for this to copy. The nature of the helper is such that any bugs would cause the tests using it to fail, so I'm okay with not having direct tests for it at present.