I do not see that as a valid solution because this solution is outside of defined usage parameters.
“A shared mailbox is not designed for direct logon. The user account for the shared mailbox itself should stay in a Disabled (or “disconnected”) state.”
For Fredrik’s solution to work, you have to set the user account to enabled.
The proper solution is having a logon name for authentication and a seperate mailbox name.