Fix authn code to use builtin Zend helpers