Add Basic Auth support part 2, close #1649