Python imaplib.authenticate() method authenticate failed on office365

java can authenticate by xoauth2 but python will authenticate failed
below is the java program demo result

python program’s result

python imaplib authenticate failed