rolled first part of authentication
merged from master