aspnetcore/samples/StaticFilesAuth
Pranav K 31bb166372
Reference Microsoft.NET.Sdk.Razor in projects with Razor files
2018-09-20 16:42:13 -07:00
..
Controllers Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
Models Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
PrivateFiles Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
Views Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
wwwroot Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
Program.cs Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
README.md Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
Startup.cs Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
StaticFilesAuth.csproj Reference Microsoft.NET.Sdk.Razor in projects with Razor files 2018-09-20 16:42:13 -07:00
appsettings.Development.json Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
appsettings.json Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00
bundleconfig.json Create a StaticFilesAuth sample #28 2018-04-20 10:48:36 -07:00

README.md

AuthSamples.StaticFilesAuth

Sample demonstrating restricting access to static files using Authentication and Authorization. There are two different approaches. Links to each scenario are provided on the home page.

  1. For a given url path, allow only authenticated users to access static files. See /MapAuthenticatedFiles in Startup.cs.
  2. For a given url path, use an authorization policy to determine who should have access to specific files. See /MapImperativeFile in startup.cs.

You can log in with any user name. For the policy scenario the user will only have access to the directory matching their name.