Backport authentication security fixes
Merge pull request #4151 from alprs/4.0-backport-auth-security

Backport authentication security fixes to 4.0