title: Connection error: Can not authenticate to IMAP server: [ALERT] Please log in via your web browser
body: <p>I am using a php script to connect imap.gmail.com, I have a paid google app account. It was working but after some time I am getting following error</p>
  
  <ol>
  <li>it says I have to login from browser but my CentsOS vps server does not have a  browser its command prompt only</li>
  </ol>
  
  <p>I am using mydomain.com</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'ImapMailboxException' with message 'Connection error: Can not authenticate to IMAP server: [ALERT] Please log in via your web browser: <a href="https://support.google.com/mail/acco" rel="noreferrer">https://support.google.com/mail/acco</a>' in /xxxxxx/classes/ImapMailbox.php:51 Stack trace: #0 /home/theluxla/public_html/_backoffice/mailpilot/classes/ImapMailbox.php(42): ImapMailbox->initImapStream() #1 /xxxxxx/classes/ImapMailbox.php(114): ImapMailbox->getImapStream() #2 /xxxxxx/mail.v3.php(28): ImapMailbox->searchMailbox('ALL') #3 {main} thrown in/xxxxx/classes/ImapMailbox.php on line 51</p>
  </blockquote>