question

HuyNguyen-1738 avatar image
HuyNguyen-1738 asked ·

Azure B2C Custom Policy - Detect user company based on email address and forward to their SSO provider

Hi,

I have successfully created a new Social login button on our B2C login screen for custom providers, but as we have more customers using our B2C logins, I would like to remove those social login buttons and auto detect the customer's company by their sign in email address and forward to their SSO provider's login page.

How can I do this with the Trust Framework Custom Policy?

Thanks,
Huy Nguyen

azure-ad-b2c
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FrankHuMSFT-3200 avatar image
FrankHuMSFT-3200 answered ·

Hey @HuyNguyen-1738 you could utilize custom JavaScript that parses the username and performs the expected action accordingly. You can learn more about custom javascript and b2c here : https://docs.microsoft.com/en-us/azure/active-directory-b2c/user-flow-javascript-overview

For more reference on this see the sso reference page below.
https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-reference-sso-custom


If you're interested in a more fleshed out solution from B2C in the portal or perhaps better documentation on how to do this, I suggest filing this as product feedback here : https://feedback.azure.com/forums/169401-azure-active-directory

And if there's enough community support the product team will look into putting this on the roadmap to implement accordingly.

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the info, @FrankHuMSFT-3200

0 Votes 0 · ·
amanpreetsingh-msft avatar image
amanpreetsingh-msft answered ·

@HuyNguyen-1738 You can use the sample: Sign In policy with Home Realm Discovery and a Default Identity Provider for this purpose.

Note: This sample is in private preview. Make sure you test all scenarios before implementing it in your production environment.


Please "mark as answer" or "vote as helpful" wherever the information provided helps you to help others in the community.




2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, @amanpreetsingh-msft I'll give it a try.

0 Votes 0 · ·

@HuyNguyen-1738 Have you had a chance to try this sample out? If it worked for you, please "accept as answer" to help others in the community.

0 Votes 0 · ·