-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Align scope used by client and server in blazor wasm template #24894
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
Align scope used by client and server in blazor wasm template #24894
Conversation
|
@Pilchie should we try to make this fix in preview8? Or should we just note it as a known issue and have the users work around it by removing the check after generating the template? |
|
Based on offline discussion, it was determined that we should match the scope used for validation to what was set here: https://github.com/dotnet/aspnetcore/blob/master/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs#L67 which is controlled by the default-scopes option. We also decided to change the default from user_impersonation to access_as_user. Note that we should update the instructions at https://github.com/aspnet/Tooling-ManualTests/blob/rel/16.7/E2EWalkthroughs/VS/AspNetCore30/30_ClientBlazorWithAADB2C.md |
Thanks @JunTaoLuo. @guardrex can you take care of the doc update? |
javiercn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
I'll assume you've done due diligence and tested the change manually.
jmprieur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
Nothing has been documented for the new APIs yet. I opened Microsoft.Identity.Web APIs for Blazor (dotnet/AspNetCore.Docs #19503), and I plan to work it when RC1 lands. |
|
I think we should at least talk to Tactics about taking this for Preview 8. Can you retarget and send mail for it? |
c1ad6c4 to
9c7c489
Compare
|
I'll send the email after I test a few more scenarios with @captainsafia |
9c7c489 to
7c23da1
Compare
|
Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge. |
7c23da1 to
251fe4e
Compare
Fixes https://github.com/aspnet/AspNetCore-ManualTests/issues/149.
Description
The scope used during validation in the WeatherForecast controller is hard coded to
access_as_user. This is an issue for the blazor-wasm template since if IndividualB2C auth is configured, the scope specified by thedefault-scopeoption will could lead to a mismatch between the client's configuration and the validation logic in the controller of the server. This change removes the hardcoding and aligns the scopes so that the same scope is used in the client and the server.Customer Impact
If the customer creates a hosted blazor wasm template (aka ComponentsWebAssembly) and selectes to use IndividualB2C auth and sets the
default-scopeoption to anything other thanaccess_as_user. The validation check in the WeatherForecast controller will fail.Regression?
Yes, this is a regression that was introduced in 5.0 preview8
Risk
Very low, this template change affects a very narrow scenario (hosted blazor wasm with IndividualB2C enabled) and has been verified locally.