In trying to meet the business requirements, we are going with the approach of using Azure B2B and B2C.80% of the users are B2B consumers whereas 20% are B2C (log in with Social Accounts) consumers.
I have to devise a navigation flow in ReactJs:
- User logs into Homepage
- Homepage checks whether User Session is present or not. If yes, it allows the user is logged-in using SSO.
- If no, the user gets redirected to the B2B Login page, where again Cookie is checked by MSAL and the user gets logged in automatically.
- If the cookie is not present, the user is allowed to enter the username on the B2B login page.
Question 1: Is there any way to show an option to the user to direct them to use the Azure B2C login page through a hyperlink only for this app (not for the entire company) if they want to use their Social Account to login?
*Question 2: If the above Question 1 is not possible, then once the user enters a username with "outlook.com", can I redirect the user to the B2C login page instead of continuing them on the B2B page as that username would fail on B2B?
Question 3: If Question 2 is also not possible, then the user reaches to below error page on login.microsoft.com. Can I customize the same to avoid going to the error page and re-direct the user to use the Azure B2C login page instead of on the block the user navigation on the error page or at least have a hyperlink on the error page with the message to direct the user to the B2C login page.*
AADSTS50020: User account '[email protected]' from identity provider 'live.com' does not exist in tenant 'XYZ' and cannot access the application 'XXX-XXX-XXX' in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.
All these questions are for avoiding creating a custom React JS landing page where the user needs to choose between corporate login (Azure B2B) and social login (Azure B2C).
Also, the possibility of adding the social federation on Azure AD (B2B) is not present as it is the organizational cloud security policy.