Wait for connectivity before attempting to authenticate