Hi Anand_Vashishtha,
I'm also having the same problem where I am able to get authentication with OAuth working for IMAP but not POP. Have you been able to resolve this issue? I have added the POP scope listed on the detailed steps but the authentication failed with the same error that you see "ERR Protocol error. Connection is closed. 10".
https://docs.microsoft.com/en-gb/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth
Here is the debug logs from Java Mail:
DEBUG POP3: connecting to host "outlook.office365.com", port 995, isSSL true
+OK The Microsoft Exchange POP3 service is ready.
CAPA
+OK
TOP
UIDL
SASL PLAIN XOAUTH2
USER
.
DEBUG POP3: Attempt to authenticate using mechanisms: XOAUTH2
DEBUG POP3: Using mechanism XOAUTH2
DEBUG POP3: AUTH XOAUTH2 command trace suppressed
DEBUG POP3: AUTH XOAUTH2 failed
As you can see the OAuth connection failed, however the same token works for IMAP and it has both IMAP and POP scopes. I'm not sure what is going on here and if it is an issue on the client, or if POP is not working or implemented.
The_Exchange_Team Any help would be appreciated!
Thanks,
Craig.