Authentication fixes

Minor fixes around authentication, including getting basic auth working again.