Question: how to connect iphone to apple id server?
Answer: connect via wifi.
Go to Settings >iCloud.
Click on your account.
Generate a verification code from another Apple device that uses the same Apple ID. ... 
Enter the verification code in the iDevice with the error.