This mimics what `RestOAuthAuthentication` above this class does.