440 Login Timeout using ExchangeClient

I’ve used the Aspose.Network library to successfully access an Exchange mailbox.



However when using the same code with a different Exchange server, I get a “440 Login Timeout” exception - this is raised instantly.



The problem appears to be that the authentication needs to be created, and the cookies stored in the Request cookie container, before the WebDav commands are issued. The following page describes the problem and the solution:



Hitchhiker guide to enterprise development | Microsoft Learn



The code in the article will work against my Exchange server - the authentication and the WebDav command runs fine.



As it stands, I cannot see a way of passing the cookie collection to the Aspose.Network library - is this possible?



Could this pre-authentication code be included in a future release, or could you provide a way of passing the cookie collection into the Exchange.ExchangeClient?



Thanks,



Mike

Hello, Mike,

Our developer is working on this issue. I will get back to you ASAP.

Cheers,

Hello, Mike,

Could you check out the attached hotfix? We have added a CookieContainer property to the ExchangeClient class. You can now assign the cookie to it.

Please let me know if it works,

Thanks

Hi Iret,

Thank you for your quick reply and hotfix. Apologies for my slow response, I have just returned from paternity leave.

Unfortunately your hotfix has not improved my situation.

Find attached my test class, which successfully connects using direct webdav calls over HTTP, then attempts to connect using the ExchangeClient using the CookieConnection. It still throws a 440 error instantly, on the line:

ExchangeMailboxInfo mailbox = client.GetMailboxInfo();

I would welcome any other suggestions you may have.

Thanks,

Mike

Hello,

I have passed your test cases, please check the attached fix.

Sorry for the delays.

Hello,

Could you please tell me whether the fix is working?

Thanks

Sorry for the delay at my end - I have only just noticed this thread has been updated.



I have tested the new fix and it works!



That’s really great and I believe that means Aspose.Network is the only component that works with Exchange using forms authentication.



Thanks for the great support.



Mike