Hi,
it's a really important and very useful extension, but I can't get it to work. Sometimes I program, so I can monitor what's going on inside the code, but I still haven't been able to connect it to the office365.com mailbox.
I went through the installation, adding libraries via composer, as well as adding the application and secret code in Azure. I believe that everything is set correctly, but the result is always the same
[pear_error: message="AUTHENTICATE XOAUTH2: A0001 NO AUTHENTICATE failed., host = outlook.office365.com, port = 993, auth-meth: XOAUTH2" code=0 mode=return level=notice prefix="" info="" ]
I was trying to debug the login process and before I set the scopes to the correct version, I was finding the wrong url scope message in the login procedure (core_pear/IMAP.php) in $pass instead of the token. Now there is a long base64 string, which should be OK.
A subsequent call to connect then returns an empty value to $ret.
The input to connect is then this:
[$this->host] => outlook.office365.com
[$user] => testdesk@***** (user)
[$pass] => eyJ******PFpxg (token)
[array] => Array
(
[port] => 993
[timeout] => 3
[ssl_mode] => tlsv1.2
[auth_type] => XOAUTH2
[force_caps] =>
)
In the connect function, it passes the tests up to the authenticate call, internally up to the branch
else if ($type == 'XOAUTH2') {
Here, the username is combined with the token and recoded to Base64 once more, stored in the $auth variable, and then the value "A0001 NO AUTHENTICATE failed" is stored. to $line and returns -1 in the result.
I've already spent over 20 hours on this and I must be doing something wrong somewhere.
The setting is
["enabled"]=> 1
["description"]=> "TestDesk"
["mailbox_type"]=> "IMAP"
["hostname"]=> "tlsv1.2://outlook.office365.com"
["port"]=> 993
["encryption"]=> "TLSv1.2"
["ssl_cert_verify"]=> 0/1 (same behavior)
["erp_username"]=>"testdesk@ ***domain*****"
["erp_password"]=> string(56) "****secret code from Azure*****"
["auth_method"]=> string(7) "XOAUTH2"
["erp_clientid"]=> string(36) "a17***client ID from Azure****c47"
["erp_redirecturi"]=> ""
["erp_tenant"]=> "abd***tenant ID from Azure***b65"
["erp_scopes"]=>"
https://outlook.office365.com/.default"
["imap_basefolder"]=>""
["imap_createfolderstructure"]=>0
However, I have tried all possible combinations of settings and the result is always the same. Only with POP3 is the message different and refers to an empty greeting message.