jamesiarmes / php-ews

PHP Exchange Web Services
http://jamesarmes.com/php-ews/
MIT License
566 stars 304 forks source link

401 Error on accounts that have not been in use. #610

Closed mcattaneo-iss closed 2 years ago

mcattaneo-iss commented 2 years ago

Version (e.g. 1.0, dev-master): PHP version: Microsoft Exchange version:

Description of problem: Certain accounts are returnint 401 upon usage of the GetPassworedExpirationDate method. The accounts are regularly used as email accounts, however EWS returns 401 when they are used in the php-ews methods. When we run a connectivity test on the account, the values all return successful. We have also tried resetting the password, this also did nothing.

Example request:

$client = new Client('outlook.office365.com', $request->json()->get('emailaddress'), $request->json()->get('password'), Client::VERSION_2016);
$client->GetPasswordExpirationDate(new GetPasswordExpirationDateType());

Example response:

Exception: SOAP client returned status of 401.
RuntimeException: Autodiscovery failed.