Thanks for the reply Sivaprakash_saripalli. I am using the https://github.com/eclipse-ee4j/mail client to connect. I have opened up a https://github.com/eclipse-ee4j/mail/issues/461 to find out if this is an issue with how the client connects, or missing properties on my application. I believe this is different to how https://developers.google.com/gmail/imap/xoauth2-protocol where the authentication command is not split into two lines, which would explain why it works for Gmail, but not Microsoft Exchange.
The specification does show the connection being made via two requests, so I will see what the response is on the Java client. Thanks for highlighting this.
Craig.