backport some unused new-style auth stuff from master for development purposes, should be harmless, RT#21563, RT#26097