Add a helper for doing oauth2 token refreshing.