We are being required to use modern authentication to connect shared mailboxes on Exchange365.
I have downloaded an example C# application (EWSModernAuthenticationApp.zip) and using this can successfully connect to our shared mailbox.
Converting this console application to VB.Net (VBNetEWSConsoleApplication.zip) and running it gives the following error
Changing the highlight line to say ”accessToken.Result” as below works and connects to the mailbox.
Dim credentials As NetworkCredential = New OAuthNetworkCredential(firstname.lastname@example.org, accessToken.Result)
Taking this code and adding it to a VB.Net WinForms test application (WinFormsConnectSharedMailbox.zip). On clicking Button1 to fire the code, the application hangs and doesn’t return a valid token.
We are using aspose.email 23.1 for all the projects.
Please can you advise, how can I connect to an Exchange shared mailbox using modern authentication in an VB.Net WinForms application?
Ian TyrrellError.PNG (58.3 KB)
WinFormsConnectSharedMailbox.zip (3.7 MB)
VBNetEWSConsoleApplication.zip (3.9 MB)
EWSModernAuthenticationApp.zip (4.3 MB)