dotnet / blazor-samples

Creative Commons Attribution 4.0 International
713 stars 609 forks source link

Add an example of "Blazor Web Hybrid App + Web API" #375

Open shushu789 opened 2 days ago

shushu789 commented 2 days ago

Hello, could you please add an example of a "Blazor Web Hybrid App + Web API"? I am a beginner with Blazor Web Hybrid apps, and I am currently unfamiliar with how to call a Web API. What I tmean is that I am not sure how to best integrate a Web API into the hybrid app solution. thanks

guardrex commented 2 days ago

Looping in @BethMassi so she sees this 👀.

This will probably happen when an existing (security) issue is worked. We still need to confirm and update our security guidance in ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/hybrid/security/?view=aspnetcore-8.0&pivots=maui

... and probably place a security-enabled (Microsoft Entra ID) MauiBlazorWeb app into this samples repo.

I hope to reach it very soon ... this week would be nice.

After confirming and updating security guidance (and probably showing app roles, Azure roles, and Azure security groups working, too), I can also demonstrate a secure web API backend.

In the meantime, we have separate coverage ...

Let's leave this issue open for now as a reminder to me. Again, I hope to work on this whole subject this week 🤞🍀. I'll see if my schedule is clear for tomorrow (Tuesday) morning to give it a another shot, as my first attempt a few weeks ago didn't go well ... the 😈 got me on that attempt 😄.

guardrex commented 1 day ago

I had good luck this morning with the in-the-BlazorWebView approach. I'm able to implement that approach successfully. However, I still think that the MSAL implementation should be handled by the PU (i.e., "product unit") because things get murky looking at MSAL docs in relation to the solution. I sent a message to Beth to discuss it. I'll report back later.