Refactor Basic authentication to new interface