dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.63k stars 25.3k forks source link

Avoid Popup #18269

Closed morganc9 closed 4 years ago

morganc9 commented 4 years ago

Hi, I'm playing with Azure B2C to see if I can use it for my company. The tutorial is quite clear and works perfectly! Thanks a lot. The only thing is when you click on Login in, it's opening another window (popup). Is there a mode when we can host the page directly into our page? I thought that the "RemoteAuthenticatorView" would make it but it's not the case.

Regarding the doc, it would be nice to have a schema of interaction/checks between azure B2C/the blazor client & the server to show how it is secured.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

guardrex commented 4 years ago

The tutorial is quite clear and works perfectly!

Thank you ❤️ for saying that @morganc9. It's still a work-in-progress. I'll be making further clarifications in the topic later this week.

Is there a mode when we can host the page directly into our page?

The flows for B2C involve UI on the Azure side by default. You can customize the UIs that Azure presents. It might be possible using MSAL, REST API, and/or Graph API to create an app-side user flow, but I've never investigated doing that myself. It would defeat one of the goals of B2C in that Azure's handling of the UI maintenance is big ⌚ and 💰 savings for a lot of companies. Anyway, you'd have to research further in the Azure docs. It's not something that we'll be addressing in our doc set here.

This is different than what you asked; but it reminds me of another question about the popup vs. redirect behaviors for Azure. I know MSAL has a configuration for pop-up vs. redirect flows, but it doesn't look like the feature is available in the library that Blazor apps use for MSAL. I tried setting the following for Azure AD config in the app settings file ...

"LoginMode": "Redirect"

The other value would be Popup.

No dice. Didn't work. Therefore, I can't document that approach at this time. I might have the wrong key tho. I'll look closer at this later.

have a schema of interaction/checks between azure B2C/the blazor client & the server to show how it is secured.

Note that the interaction is (for the most part) already published for MSAL docs, since that's what's being used.

Artak, I think @morganc9's request could be boiled down to cross-linking MSAL doc(s) that already have the flow(s) published. If you agree, let's try to do that first. If I fail to find good content, I can let you know back here later.

@morganc9 These issues are usually triaged on Fridays. Whatever we do here, there will be a delay if it isn't just a simple cross-link to existing MSAL docs. We have a TON 😅 of open high priority issues that we need to burn through right now. I suspect that I'll get to this in June if I actually need to write content for this.

morganc9 commented 4 years ago

Many thanks for your response!

The Redirect option might be a good solution. For June as well :)?

guardrex commented 4 years ago

I'm not sure when/if it will be available ... and I might merely have the key in the app settings file wrong to set that configuration. We should get an answer soon-ish ... this should be seen on Friday.

morganc9 commented 4 years ago

Any news on the redirection? It's blocking me from using B2C for my website :/ looks like it is possible with MSLA.js but not the .Net one: https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-sign-in?tabs=javascript ?

guardrex commented 4 years ago

Nothing yet. These issues are usually triaged on Fridays, so we might get some feedback from Artak today or on Friday, June 5th.

morganc9 commented 4 years ago

Hi, Do you have any news? The issue seems to have been ignored so far.

guardrex commented 4 years ago

Let's do this ... open and issue and ask on the engineering repo at ...

https://github.com/dotnet/aspnetcore/issues

I have a feeling that the login mode (popup vs. redirect) isn't configurable, but Javier will let you know and if there's anything else (a workaround) for the behavior.

Please add a cc: @guardrex to your issue's opening comment. I'll re-open and work this issue if we get some actionable doc content for this.