Since this question is related to EWS and Exchange Development, I have added the tag "office-exchange-server-dev" to it.
Thanks for your understanding.
Have you disabled security defaults in your tenant? If not, it may also block basic auth.
And if you have this user added to Conditional Access policy, it may also be the possible cause of this issue.
If the above didn't help with this issue, you may also use the self-help tool to check and modify the settings in your tenant: Basic Auth self-help diagnostic
Example:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.