'Azure AD B2C - B2C User or Guest User

I want to invite users to my page, but I want them to be able to login with SSO (when invited as guests), or to login with an email and password.

Is there a way to find out programmatically, if I should invite the user as a guest user, or create it as a B2C user who would get an email from where he would go to the password setup/reset "flow"?

I guess I need to check if the email provided is a Microsoft or Azure AD account, or not? Is something like that possible and if yes, how exactly?

Thanks a lot!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source