Fix strong authentication, add new tests

This reverts commit 3ea55d6ca954b8ecba868fb9d20e275a8dd7772e.