Duplicate Emails, Usernames and API Authentication

Hi All,

We have a situation where we have several legacy applications (which cannot be changed) using basic authentication to access backend API’s. We are looking to use auth0 for authentication and as such want to move the credentials into auth0 from .Net Identity. Unfortunately the current implementation uses a username rather than an email address. We are aware that auth0 supports username or email address however we have cases where a username can have the same email address as another user (usually because of multi-tenancy). This errors because the email must be unique in auth0. We have found this GIT example GitHub - abbaspour/auth0-duplicate-email: Users with duplicate non-unique Emails in Auth0 however this users the classic login flow and was wondering if this could be done in the New Login Experience using a rule or action. This example relies on using a custom reset password implementation.
In addition to this since the basic auth api’s are still a requirement is it possible to safely pass the basic auth from the old API’s and authenticate against auth0?