title: Unable to connect to gmail via Gmail API. How can we turn on Less secure app access?
body: <p>I am connecting to the gmail account to verify the confirmation emails sent by our application. When implementing it originally, in order to connect to gmail successfully, we had to set the account with 'Less secure app access' configuration to ON.</p>
  <p>Looks like google turned that setting to off now from May 30,2022 and so the authentication is failing now.</p>
  <p>How can I connect to Gmail account to verify the confirmation emails now?</p>
  <p>java.lang.RuntimeException: javax.mail.AuthenticationFailedException: [AUTHENTICATIONFAILED] Invalid credentials (Failure)</p>