You can grant Send As/Send on behalf permissions (so that the mailbox you are authenticating as, foo@keyman .com, can send on behalf of bar@keyman .com). You can use the Microsoft 365 Admin Center, the Exchange Admin Center or PowerShell to grant the permissions, let me know if you need more details.
If you want to rely on the Graph API completely, you can grant the Mail.Send application permission, which allows you to impersonate (send on behalf of) every user in the organization.