Creating an authenticated client factory