How to auth a user which exists in multiple idp s

we have customers who hold multiple tenants at our product. each is authenticated with a different idp. (some from a production idp and some from a sandbox\testing).
how can we make sure a user with the same username is authenticated via the correct IDP?
we are using a custom login screen and the idp routing.
can we use a profile attribute? should we create multiple users for them?