The reason this is so complicated is that the solution, which I have found, is counter intuitive. I worked it out with Apple Support in Ireland. They did not know the answer, and because the system I am using is officially obsolete, they will not update their database. I am using 10.9.5 on a MacMini.
THIS IS THE SOLUTION
Enter your Apple ID password when requested.
Choose ALLOW from your other device.
A verification code will be generated on your other device. Note down this code.
When it tells you to enter your password and verification code on your Mac, there is a dialogue box saying OK.
You don't have to enter your password and the verification code into empty space.
CLICK OK, and nothing seems to happen.
THEN as if you are starting the whole process again, ONLY THEN enter your password AND the verification code all in one string with no spaces anywhere i.e. PASSWORD123456 (Where PASSWORD is your password and 123456 is your verification code).
Yes it is very frustrating, and I tried doing it a hundred ways first. It is counter intuitive because you use the passcode generated in your last sign in attempt in the NEXT attempt at logging in.
Good luck.
Andrew