Replace missing code in Authenticate extension. Fixes #944