8

So I was thinking of using MSAL for authentication against the AZURE B2C Identity Provider, but from what I can see by looking at the code, MSAL is dependent on pop up windows for logins. (Please correct me if I'm wrong).

My question is, given that B2C sites are consumer facing, isn't the use of pop up windows highly discouraged, given that many of your potential site users may have pop up disabled? I'm having difficulty finding a good example of how to plug Azure B2C into an angular2 app without pop up windows.

user4520
  • 3,401
  • 1
  • 27
  • 50
Jim Taliadoros
  • 495
  • 4
  • 13
  • there's a loginRedirect method but I'm seeing improper behavior w/ it [github issue](https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/102) – spottedmahn Aug 10 '17 at 16:02

2 Answers2

4

You can actually use loginRedirect() instead of loginPopup(); however, Azure B2C does not yet support custom domains for the login page, so your users will be redirected to a variant of https://login.microsoftonline.com. This isn't terrible if you setup branding on your Azure AD tenant, but there is a bug where users may get a 400 error. ( http 400: size of header request is too long when signing in user using Multifactor authentication )

Nsevens
  • 2,588
  • 1
  • 17
  • 34
Granville Schmidt
  • 399
  • 1
  • 3
  • 16
0

You can use hello.js for your spa application. This does not have any popup, 100% consistent and very light weight, so you don't have to deal with any popup's. It is very flexible too. We are using that in our current project. You can find the sample for angular 2 app. https://github.com/karthikeyanVK/ng2AzureAdB2C

Karthikeyan VK
  • 5,310
  • 3
  • 37
  • 50
  • It is a good practice to suggest a solution rather than linking to an external source. Are you able to summarize the key concepts from your linked code which answer the above question? – Shailen Sukul Nov 13 '17 at 10:13
  • @ShailenSukul I have suggested to use hello.js rather than use MSAL and link has the working example. May be i would have worded better. MSAL is not stable solution. – Karthikeyan VK Nov 14 '17 at 08:44
  • You are still not getting it.. There is no guarantee that your link will be around forever. Can you post the code in your answer? – Shailen Sukul Nov 23 '17 at 03:26
  • @ShailenSukul, code is just for reference, whole point is use hello.js. You should read questions and my answers again. Ur pretty new to stackoverflow. U have no idea what Best practice is. Read my answer again. – Karthikeyan VK Nov 23 '17 at 04:14
  • 1
    Actually this looks like exactly what I need. Thank you! – w3bMak3r Mar 21 '19 at 14:05