Although oliveiradani94's suggestion will work, it is NOT the correct solution to this issue!
The correct solution is that posted by Joy V on 9/23/13, and is explained in detail on page Joy V posted. Unfortunately the link is faulty which may be why the solution hasn't been given points. However, a quick Google search yields the following link for
the page:
Correct Solution:
App Passwords and Two-Step
Verification
To resolve the error, simply follow the link and follow the three steps listed on the page. If you want to better understand the issue, read on.
The issue with signing in on devices such as the iPhone is NOT a bug. Two-step verification is an extremely effective security feature which requires the device signing in to request a security code which Microsoft generates and
will send to any other method of contact associated with your account (i.e. another email address or a telephone number). This issue is that apps like the iPhone Mail app and other device apps don't know that they have to ask for this security code, so your
Microsoft account does the correct thing and prevents it from accessing your account at all. This is not a bug, this is a security measure. If anything, the fault lies with Apple for not allowing for two-step verification within its Mail app.
So long story short, this sign-in error is not a bug, it's simply due to some useful security features that Microsoft allows you to put in place. You can disable them and the error will go away (but your account will be more vulnerable),
or you can generate an App Password as described in the link above, keep your account more secure, and still sign in on your device. Hope this helps!