I'm getting an :"Authentication Failure" error. on my IMAP

Problem solved. Setting up two-stage authentication on icloud, solved the issue.