HTTP authentication changes. Still has some TODOS.