Added re-trying and sleeping to getAuthenticatedUser