0 votes
by (170 points)

Rebex Pop3(Version=6.0.8372.0) Login throws 'Authentication failure: unknown user name or bad password.'
when trying to login using Access token and OAuth20 .
Access mode being used is 'app-only' and 'POP.AccessAsApp' permission is set.

1 Answer

0 votes
by (144k points)

Configuring Microsoft 365 account for app-only POP3 access is very complicated. In addition to setting 'POP.AccessAsApp' and granting admin consent, you also have to add mailbox access permissions, which involves creating, configuring and registering a "principal".

Please check out the following article and make sure you followed all the steps. They are all important.

Office 365 and IMAP or POP3 with OAuth 2.0 authentication in unattended (app-only) mode: How to make it work

by (170 points)
thanks for the prompt response.
i have couple of questions :
- to give full access to all the mailboxes , how to get complete list of mail boxes
- which address corresponds to 'SmtpAddress' param in Login method? and where do we use service principal display name after registering?
by (144k points)
- Use Get-Mailbox cmdlet to get a list of mail boxes: https://learn.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps
- In the Login method, the first parameter specifies the mailbox address from step 18.
- You don't use the principal display name anywhere. It's just a display name to help you identify the principal's purpose.
...