Skip to content

Commit

Permalink
updating to fix auth sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sayedihashimi committed Oct 23, 2020
1 parent 5880dd4 commit 878cdf3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Content/MyWebAppWithAuth/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,25 @@
"choice": "Individual",
"description": "Individual authentication"
},
{
"choice": "IndividualB2C",
"description": "Individual authentication with Azure AD B2C"
},
{
"choice": "SingleOrg",
"description": "Organizational authentication for a single tenant"
},
{
"choice": "MultiOrg",
"description": "Organizational authentication for multiple tenants"
},
{
"choice": "Windows",
"description": "Windows authentication"
}
],
"defaultValue": "None",
"description": "The type of authentication to use"
},
"NoAuth": {
"type": "computed",
"value": "(!(IndividualAuth || OrganizationalAuth || WindowsAuth))"
},
"IndividualLocalAuth": {
"type": "computed",
"value": "(auth == \"Individual\")"
},
"WindowsAuth": {
"type": "computed",
"value": "(auth == \"Windows\")"
}
}
}
7 changes: 7 additions & 0 deletions src/Content/MyWebAppWithAuth/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Hello, AuthorName, this is a sample template for an asp.net core web app.</p>
@*#if (NoAuth)
<p>auth selected no auth</p>
#elseif (IndividualLocalAuth)
<p>auth selected individual</p>
#elseif (WindowsAuth)
<p>auth selected windows</p>
#endif*@
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
8 changes: 8 additions & 0 deletions src/Content/MyWebAppWithAuth/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

#if (NoAuth)
// auth selected: no auth
#elif (IndividualLocalAuth)
// auth selected: individual
#elif (WindowsAuth)
// auth selected: windows
#endif

namespace MyWebApp {
public class Startup {
public Startup(IConfiguration configuration) {
Expand Down

0 comments on commit 878cdf3

Please sign in to comment.