[CLC-1442] Tons of code to support basic auth

JIRA: https://jira.media.berkeley.edu/jira/browse/CLC-1442