-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing instructions, Code example cause internal Server error #27279
Comments
Hello @hjrb ... I'm OOF for only about an hour. I'll take a look at this and get back to you soon. |
Ok ... I'm BACK! This topic, and the other WASM security node topics are due for a pass on #24615, which is scheduled for the 🦃 to 🎁 time frame at the end of this year. I was going to perform a considerable overhaul of the whole node, but we decided that that would be too costly 💰 given that how Blazor WASM deals with security is likely to receive a big review next year with possible major updates for .NET 8 at the end of 2023. Therefore, it was decided that spending a lot of 💲💵💲on it right now isn't a good idea. Still tho ... I'd like to give the node a pass when things cool off after .NET 7 comes out in November. That's approved by management. What's probably going to happen to your issue here is that I'll close this but cross-link these remarks on that tracking issue for review when the updates are being made. I'll refer back to this at that time. Now, for your specific points ...
Fair enough ... it's when you reach the Server app configuration section that it begins to just talk about what's in the solution. I agree with you on this point. I'll tend to this on the updates later.
I think this is because the sizes of our headings aren't very different and there are perhaps too many subsections between the major headings for Server and Client app sections. Therefore, it's hard to see the divisions between the Server app configuration section (with its subsections) and the Client app configuration section (with its subsections). It's a good idea to clean this problem up, too. I agree with you, and I'll tend to this here and on all of the topics in this node.
Ah! Good question ... and the answer is localization into other languages. Our docs are automatically (machine) translated and human translated, BUT not for code comments. Therefore to reach everyone, we need to keep remarks in the text. Now, I do try to explain the code in the text. To the extent that I don't do a good job on a section ... or a topic 🙈😄, I make updates to improve the text. I'll assess this point as well on the updates later.
It should work. Make sure you're looking at the version of the topic that matches your app version because there was a change at 6.0. There could be a version-specific problem that I'm not aware of. This will require further investigation if the exact problem isn't reported to me. I'd look as soon as I can, but it might get pushed to November if the specific problem isn't reported because this is the first time the feedback has come in and this was working earlier.
IIRC, this section of the topic was added relatively recently, possibly at reader request. It's not helpful to avoid placing an
The whole topic is about hosting in Azure. That's what this topic describes. I think what's happened is just that the error you hit needs to be resolved and it will work 🤞🍀. Can you put up a minimal repro project of your failing app for me to look at? Just strip out the sensitive strings in the app settings files of the Client and Server projects. If you can't tho, there might be a delay ... maybe only a short delay ... for me to take a look, as I'm working on a number of .NET 7 release issues right now and have a hard deadline coming for final release of 7.0 in early November.
I agree. A lot of it is due to the wide array of features and use case scenarios that can be covered by the framework(s) and the Azure platform. This is meant to be the simplest set of instructions ... with a few extra explanations and 😈 gotcha items to watch out for ... and it's still complicated 😩. For the most part, the topics in this node don't generate a lot of negative feedback, but I know that devs run into problems. Let's see if we can get your app running, and I'll take a look at the whole node using everyone's feedback later this year. You can see the wide array of issues opened at that tracking issue ... ... scroll down to the UE pass tracking bit and look at the Security and Identity node entries. |
I'm going to need to temporarily remove that INCLUDE for the BTW ... The Let me know if you can put up that repro project for the basic Azure hosting scenario (without the Unfortunately, I don't have a web API cross-link. The It's the same general concept for a web API (i.e., the Server app of a hosted WASM solution); but like I said, it's going to take me more time to work out the coverage for the scenario than I have at the moment. |
Hi my test app is on github https://github.com/hjrb/VSSApp - which user would I need to grant access? |
I'm not sure because I don't work with private GH repos. Prior to writing docs for the .NET foundation/Microsoft, I never used GH. We had different source control systems at every company I ever worked for. Normally, we request a public minimal repro project. If you can't grant me access to that, then you'd either need to make it public or wait for me to circle around to this later this year ... I hope 🤞🍀. |
I invited you |
Ok ... cool. I see the repo now. I'll try and take a look today (Friday). I'm buried in .NET 7 stuff at the moment ⛰️⛏️😅, but I might be free of it later this morning. If not tho ... if you don't hear back from me today ... I'll be back Monday/Tuesday to take a look and respond. |
FYI ... Yes! ... I'm running out of time today ... rapidly running out of time 🏃♂️🕐😄. I can see that just to finish this .NET 7 thing that I'm working on that I'll exhaust my schedule today with it. I'll get back to this on Monday/Tuesday next week. I apologize for the delay, but we have a hard deadline for the .NET 7 documentation. It all has to be in place and ⚡ LIVE ⚡ on release day or HEADS WILL ROLL! 🔪😨🤣 |
I took a look, @hjrb ... a few points ...
Anyway, I mention all of this to let you know that several of your suggestions can be rolled into the updates, BUT it's unlikely that we'll duplicate any coverage here that I can cross-link in the Azure docs (e.g., MS Graph). It depends ... if I can use their guidance cleanly without problems, then I can just concentrate our coverage on the Razor component aspects. If I encounter pain 😩 and problems 😩 implementing their guidance in Blazor apps, I shouldn't drop coverage here and try to fix it up as much as I can without performing a total overhaul. Well ... I wrote another BOOK 📖 here! 🙈🤣 What you can do is consider my points for your app ...
WRT to this issue: I am going to close it shortly as just a discussion. However, I will be making the agreed-upon suggestions that you made when I make that pass on this node after 🦃 day. I'll be working through all of the docs with test apps to update the code. For example, I missed one thing for sure in one spot ... Minimal APIs for the server app ... I see Even with this issue closed, please feel free to provide additional information on this issue for me to see later. For example, I hope to hear that you did get your app working and what you were able to fix to get it running. That could be an important thing for the doc updates EOY. I like to call out gotchas 😈 that devs might hit when building apps. This issue is cross-linked to my tracking issue for the work, so your comments here won't be lost after I close this. |
I'll close now ... but again ... please feel free to post here what the problem turned out to be with the app. That might be something that articles can call out if it might bite other devs 😈. |
Hello,
overall it works locally. Here are some points to improve:
public class ApplicationUser : IdentityUser
{
// public virtual string Email { get; set; } // example, not necessary
}
Else the code sample will not compile.
The code sample causes the API server to crash. Already adding the dependency injction reference
public WeatherForecastController(ILogger logger
,UserManager userManager
)
{...
is enough for the app to crash.
Add
builder.Services.Configure(options =>
options.ClaimsIdentity.UserIdClaimType = ClaimTypes.Upn);
to the program.cs file BEFOR builder.Build() doesn't help
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: ConstructorContainsNullParameterNames, Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService
3+JavaScriptLoggingOptions[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState,Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount,Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions] SerializationNotSupportedParentType, System.Object Path: $. System.NotSupportedException: ConstructorContainsNullParameterNames, Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService
3+JavaScriptLoggingOptions[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState,Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount,Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions] SerializationNotSupportedParentType, System.Object Path: $.---> System.NotSupportedException: ConstructorContainsNullParameterNames, Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService`3+JavaScriptLoggingOptions[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState,Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteUserAccount,Microsoft.Authentication.WebAssembly.Msal.Models.MsalProviderOptions]
PLEASE ALWAYS ADD a section how to deploy to Azure. IT ISN'T TRIVIAL!!
Overall using Blazor and .NET Core with AAD feels like black magic. EXTREMLY complicated. The support by VS 2022 isn't really working.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: