Merge branch 'merge/release/2.2-to-master'

This commit is contained in:
Ryan Brandenburg 2018-08-23 10:32:20 -07:00
commit 3570f1a2b1
26 changed files with 161 additions and 151 deletions

View File

@ -2,7 +2,6 @@ trigger:
- master
- release/*
# See https://github.com/aspnet/BuildTools
resources:
repositories:
- repository: buildtools
@ -11,36 +10,4 @@ resources:
ref: refs/heads/master
phases:
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Windows
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: macOS
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Linux
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs
- template: ../templates/project-ci.yml

View File

@ -12,36 +12,4 @@ resources:
ref: refs/heads/master
phases:
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Windows
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: macOS
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Linux
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs
- template: ../templates/project-ci.yml

View File

@ -0,0 +1,36 @@
# See https://github.com/aspnet/BuildTools
phases:
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Windows
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: macOS
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools
parameters:
agentOs: Linux
beforeBuild:
- task: NodeTool@0
displayName: Use Node 8.x
inputs:
versionSpec: 8.x
- script: ./run.sh install-tools; $(Agent.WorkFolder)/.dotnet/dotnet dev-certs https
displayName: install certs

View File

@ -46,6 +46,6 @@
<XunitPackageVersion>2.3.1</XunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.0</XunitRunnerVisualStudioPackageVersion>
</PropertyGroup>
<PropertyGroup Label="Package Versions: Pinned" />
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
<PropertyGroup Label="Package Versions: Pinned" />
</Project>

View File

@ -9,7 +9,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
"groupIdentity": "Microsoft.Web.Empty",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.Empty.CSharp.3.0",
"shortName": "web",
"tags": {

View File

@ -8,7 +8,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "An empty project template for creating an ASP.NET Core application. This template does not have any content in it.",
"groupIdentity": "Microsoft.Web.Empty",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.Empty.FSharp.3.0",
"shortName": "web",
"tags": {

View File

@ -11,7 +11,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project for creating a Razor class library that targets .NET Standard",
"groupIdentity": "Microsoft.Web.Razor",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.Razor.Library.CSharp.3.0",
"shortName": "razorclasslib",
"tags": {

View File

@ -10,7 +10,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Razor Pages content",
"groupIdentity": "Microsoft.Web.RazorPages",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.RazorPages.CSharp.3.0",
"shortName": [
"razor",

View File

@ -18,7 +18,7 @@
</head>
<body>
<header>
<nav class="mb-3 navbar navbar-expand navbar-light flex-column flex-md-row bg-white border-bottom box-shadow">
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/">Company.WebApplication1</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
@ -31,7 +31,7 @@
#elseif (WindowsAuth)
<p class="nav navbar-text navbar-right">Hello, @User.Identity.Name!</p>
#endif*@
<ul class="navbar-nav ml-md-auto">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Page1</a>
</li>
@ -51,7 +51,9 @@
</div>
<footer class="border-top footer pl-3 text-muted">
&copy; Year - Company.WebApplication1 - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<div class="container">
&copy; copyrightYear - Company.WebApplication1 - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
<environment include="Development">

View File

@ -1,25 +1,26 @@
@using Microsoft.AspNetCore.Identity
@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager
<ul class="navbar-nav">
@if (SignInManager.IsSignedIn(User))
{
<form asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })" method="post" id="logoutForm" class="navbar-right">
<ul class="nav navbar-nav navbar-right">
<li>
<a asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>
</li>
<li>
<button type="submit" class="btn btn-link navbar-btn navbar-link">Logout</button>
</li>
</ul>
</form>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
</li>
<li class="nav-item">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })">
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
</form>
</li>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="Identity" asp-page="/Account/Register">Register</a></li>
<li><a asp-area="Identity" asp-page="/Account/Login">Login</a></li>
</ul>
}
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
</li>
}
</ul>

View File

@ -9,39 +9,49 @@
#endif *@
<ul class="navbar-nav">
@*#if (IndividualB2CAuth)
@if (User.Identity.IsAuthenticated)
{
<ul class="nav navbar-nav navbar-right">
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
{
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">Hello @User.Identity.Name!</a></li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</a>
</li>
}
else
{
<li class="navbar-text">Hello @User.Identity.Name!</li>
<li class="nav-item">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</li>
}
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a>
</li>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a>
</li>
}
#else
@if (User.Identity.IsAuthenticated)
{
<ul class="nav navbar-nav navbar-right">
<li class="navbar-text">Hello @User.Identity.Name!</li>
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
</ul>
<li class="nav-item">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a>
</li>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a>
</li>
}
#endif *@
#endif *@
</ul>

View File

@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Authentication.AzureADB2C.UI;
using Microsoft.AspNetCore.Builder;
#if (IndividualLocalAuth)
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
#endif
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@ -69,6 +70,7 @@ namespace Company.WebApplication1
Configuration.GetConnectionString("DefaultConnection")));
#endif
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>();
#elif (OrganizationalAuth)
@ -147,6 +149,7 @@ namespace Company.WebApplication1
{
app.UseExceptionHandler("/Error");
#if (RequiresHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

View File

@ -9,7 +9,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
"groupIdentity": "Microsoft.Web.Mvc",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.Mvc.CSharp.3.0",
"shortName": "mvc",
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
@ -360,4 +360,4 @@
"continueOnError": true
}
]
}
}

View File

@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Authentication.AzureADB2C.UI;
using Microsoft.AspNetCore.Builder;
#if (IndividualLocalAuth)
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
#endif
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@ -69,6 +70,7 @@ namespace Company.WebApplication1
Configuration.GetConnectionString("DefaultConnection")));
#endif
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>();
#elif (OrganizationalAuth)
services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
@ -146,6 +148,7 @@ namespace Company.WebApplication1
{
app.UseExceptionHandler("/Home/Error");
#if (RequiresHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

View File

@ -20,7 +20,7 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" href="~/">Company.WebApplication1</a>
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Company.WebApplication1</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>

View File

@ -1,22 +1,26 @@
@using Microsoft.AspNetCore.Identity
@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager
<ul class="navbar-nav">
@if (User.Identity.IsAuthenticated)
{
<li class="nav-item">
<a id="manage" class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
</li>
<li class="nav-item">
<form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/Index", new { area = "" })">
<button id="logout" type="submit" class="nav-link btn btn-link text-dark">Logout</button>
</form>
</li>
}
else
{
<li class="nav-item">
<a class="nav-link text-dark" id="register" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" id="login" asp-area="Identity" asp-page="/Account/Login">Login</a>
</li>
}
@if (SignInManager.IsSignedIn(User))
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
</li>
<li class="nav-item">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
</form>
</li>
}
else
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
</li>
}
</ul>

View File

@ -10,39 +10,49 @@
#endif *@
<ul class="navbar-nav">
@*#if (IndividualB2CAuth)
@if (User.Identity.IsAuthenticated)
{
<ul class="nav navbar-nav navbar-right">
@if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
{
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">Hello @User.Identity.Name!</a></li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="EditProfile">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</a>
</li>
}
else
{
<li class="navbar-text">Hello @User.Identity.Name!</li>
<li class="nav-item">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</li>
}
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignOut">Sign out</a>
</li>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureADB2C" asp-controller="Account" asp-action="SignIn">Sign in</a>
</li>
}
#else
@if (User.Identity.IsAuthenticated)
{
<ul class="nav navbar-nav navbar-right">
<li class="navbar-text">Hello @User.Identity.Name!</li>
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a></li>
</ul>
<li class="nav-item">
<span class="nav-text text-dark">Hello @User.Identity.Name!</span>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignOut">Sign out</a>
</li>
}
else
{
<ul class="nav navbar-nav navbar-right">
<li><a asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a></li>
</ul>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="AzureAD" asp-controller="Account" asp-action="SignIn">Sign in</a>
</li>
}
#endif *@
#endif *@
</ul>

View File

@ -9,7 +9,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating an ASP.NET Core application with example ASP.NET Core MVC Views and Controllers. This template can also be used for RESTful HTTP services.",
"groupIdentity": "Microsoft.Web.Mvc",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.Mvc.FSharp.3.0",
"shortName": "mvc",
"thirdPartyNotices": "https://aka.ms/aspnetcore-template-3pn-210",
@ -153,4 +153,4 @@
"continueOnError": true
}
]
}
}

View File

@ -31,6 +31,7 @@ type Startup private () =
else
app.UseExceptionHandler("/Home/Error") |> ignore
#if (!NoHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts() |> ignore
app.UseHttpsRedirection() |> ignore

View File

@ -9,7 +9,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
"groupIdentity": "Microsoft.Web.WebApi",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.WebApi.CSharp.3.0",
"shortName": "webapi",
"tags": {

View File

@ -56,6 +56,7 @@ namespace Company.WebApplication1
#if (RequiresHttps)
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

View File

@ -8,7 +8,7 @@
"generatorVersions": "[1.0.0.0-*)",
"description": "A project template for creating an ASP.NET Core application with an example Controller for a RESTful HTTP service. This template can also be used for ASP.NET Core MVC Views and Controllers.",
"groupIdentity": "Microsoft.Web.WebApi",
"precedence": "3000",
"precedence": "5000",
"identity": "Microsoft.Web.WebApi.FSharp.3.0",
"shortName": "webapi",
"tags": {

View File

@ -29,6 +29,7 @@ type Startup private () =
app.UseDeveloperExceptionPage() |> ignore
#if (!NoHttps)
else
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts() |> ignore
app.UseHttpsRedirection() |> ignore
@ -37,4 +38,4 @@ type Startup private () =
#endif
app.UseMvc() |> ignore
member val Configuration : IConfiguration = null with get, set
member val Configuration : IConfiguration = null with get, set

View File

@ -42,6 +42,7 @@ namespace Company.WebApplication1
{
app.UseExceptionHandler("/Error");
#if (!NoHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

View File

@ -42,6 +42,7 @@ namespace Company.WebApplication1
{
app.UseExceptionHandler("/Error");
#if (!NoHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

View File

@ -42,6 +42,7 @@ namespace Company.WebApplication1
{
app.UseExceptionHandler("/Error");
#if (!NoHttps)
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}