-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Updating Web project templates to ms.id.web 0.3.0-preview #25309
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
Updating Web project templates to ms.id.web 0.3.0-preview #25309
Conversation
and quick fix to the Blasorwasm default values for the Web api so that customers have a better experience
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.
Some minor style feedback.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
...mplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
...emplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs
Outdated
Show resolved
Hide resolved
...ectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/.template.config/dotnetcli.host.json
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
Some rough notes on how to test the new templates from a PR build. I'm omitting some small details but let me know if any of the steps are confusing.
|
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.
Minor spacing fixes. I'm approving this now but @Tratcher @blowdart @javiercn @captainsafia should also take a look at the new API and template changes.
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
@@ -116,7 +119,7 @@ public void ConfigureServices(IServiceCollection services) | |||
services.AddRazorPages(); | |||
#if (OrganizationalAuth || IndividualB2CAuth) | |||
services.AddServerSideBlazor() | |||
.AddMicrosoftIdentityConsentHandler(); | |||
.AddMicrosoftIdentityConsentHandler(); |
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.
Indents
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.
Ditto
#endif | ||
.AddInMemoryTokenCaches(); | ||
#else | ||
.AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAd")); |
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.
Extra indent
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.
Fixed
src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs
Outdated
Show resolved
Hide resolved
using Microsoft.Identity.Web; | ||
using Microsoft.Identity.Web.UI; | ||
using Microsoft.Identity.Web.TokenCacheProviders.InMemory; | ||
using Microsoft.AspNetCore.Authorization; |
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.
sort
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.
Fixed
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.
Hmm seems like it isn't sorted, move this line to line 8
src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
@@ -112,7 +111,7 @@ public void ConfigureServices(IServiceCollection services) | |||
#endif | |||
#if (OrganizationalAuth || IndividualB2CAuth) | |||
services.AddRazorPages() | |||
.AddMicrosoftIdentityUI(); | |||
.AddMicrosoftIdentityUI(); |
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.
Indent
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.
Ditto, revert indentation.
src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Startup.cs
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Startup.cs
Show resolved
Hide resolved
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.
It looks in line with the agreed design.
...emplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs
Outdated
Show resolved
Hide resolved
I'll clean up the templates's indenting and react to feedback to get this merged today. |
I'm updating the PR right now (after testing) |
Hey folks, seems like the changes that we did originally broke the Blazor server individual auth template. Any chance we can get that addressed as part of this? #25353 |
Sure, can you push a commit to this branch @javiercn |
Ah we don't have permission to push to your branch since it's in your fork. @javiercn I think there's no benefit to piggy-backing off of this PR. Care to send a separate one? |
@jmprieur thanks for taking care of it.
I'm fine having it as a separate PR as long as we fix it, hopefully before Tuesday to avoid going through full ask-mode. |
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.
I realized my previous comment was misleading.
#endif | ||
#endif | ||
#if (OrganizationalAuth || IndividualB2CAuth) | ||
services.AddControllersWithViews() | ||
.AddMicrosoftIdentityUI(); | ||
.AddMicrosoftIdentityUI(); |
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.
.AddMicrosoftIdentityUI(); | |
.AddMicrosoftIdentityUI(); |
Sorry I mean that these extra indentations should be removed. As in revert the change to this line.
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.
Oh, I see :). Will do.
@@ -116,7 +119,7 @@ public void ConfigureServices(IServiceCollection services) | |||
services.AddRazorPages(); | |||
#if (OrganizationalAuth || IndividualB2CAuth) | |||
services.AddServerSideBlazor() | |||
.AddMicrosoftIdentityConsentHandler(); | |||
.AddMicrosoftIdentityConsentHandler(); |
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.
Ditto
@@ -105,11 +103,11 @@ public void ConfigureServices(IServiceCollection services) | |||
options.FallbackPolicy = options.DefaultPolicy; | |||
}); | |||
services.AddRazorPages() | |||
.AddMvcOptions(options => {}) | |||
.AddMicrosoftIdentityUI(); | |||
.AddMvcOptions(options => {}) |
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.
Ditto, revert the extra indentations here and on lines 107 and 110
using Microsoft.Identity.Web; | ||
using Microsoft.Identity.Web.UI; | ||
using Microsoft.Identity.Web.TokenCacheProviders.InMemory; | ||
using Microsoft.AspNetCore.Authorization; |
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.
Hmm seems like it isn't sorted, move this line to line 8
@@ -112,7 +111,7 @@ public void ConfigureServices(IServiceCollection services) | |||
#endif | |||
#if (OrganizationalAuth || IndividualB2CAuth) | |||
services.AddRazorPages() | |||
.AddMicrosoftIdentityUI(); | |||
.AddMicrosoftIdentityUI(); |
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.
Ditto, revert indentation.
@JunTaoLuo @javiercn : I just gave you permissions to my fork. |
Summary of the changes
Identity and ASP.NET Core team agreed
This removes several files which are now part of Microsoft.Identity.Web
The projects will need to reference Microsoft.Identity.Web 0.3.0-preview
Addresses #bugnumber (in this specific format)