I may have spoken too soon. `authenticate_or_request_with_http_basic` might clean this up a bunch. Taking another stab at it.