Got authentication working (I think).