This changed sometime in 2014. You used to be able to use IMAP authtype 'simple', but in April 2014, Google released a rather vague blog post [1] about how they're going to deprecate something; please move to OAuth 2.0.
The Thunderbird team's bug tracker has some context [2] where they had to move quickly to add functionality to Thunderbird to support the SASL XOAUTH2 for IMAP so that Thunderbird would keep working with Gmail.
[1] https://security.googleblog.com/2014/04/new-security-measure...