Skip to content

Commit f5ca1d3

Browse files
authored
Merge pull request #12 from myusrn/master
migrating use of wwwroot/auth to wwwroot/.auth for al
2 parents 8331eea + 09212a0 commit f5ca1d3

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,5 +329,5 @@ ASALocalRun/
329329
# MFractors (Xamarin productivity tool) working folder
330330
.mfractor/
331331

332-
**/wwwroot/auth/**/*.*
332+
**/wwwroot/.auth/**/*.*
333333
!tools/GitVersion/**/

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ If you want to add roles to the `User` property you can have a look in `Transfor
8585

8686
### Local Debugging
8787

88-
For debugging your application you can place a `me.json` in the `wwwroot/auth` folder of your web app and add some configuration to the `AddEasyAuth` call.
88+
For debugging your application you can place a `me.json` in the `wwwroot/.auth` folder of your web app and add some configuration to the `AddEasyAuth` call.
8989
For example:
9090

9191
```
@@ -94,15 +94,17 @@ For example:
9494
{
9595
if (this.Environment.IsDevelopment())
9696
{
97-
options.AuthEndpoint = "auth/me.json";
97+
options.AuthEndpoint = ".auth/me.json";
9898
}
9999
}
100100
);
101101
```
102102

103103
> **Info**: You can obtain the content for this file from an Azure Web App with EasyAuth configured by requesting the `/.auth/me` endpoint.
104104
105-
> **Info**: Make sure you added static file handling to your pipeline by adding `app.UseStaticFiles();` to your `public void Configure` method in the `Startup.cs`. Otherwise the file can not be found at runtime.
105+
> **Info**: Make sure you added static file handling to your pipeline by adding `app.UseStaticFiles();` to your `public void Configure` method in the `Startup.cs`, e.g. just after `app.UseHttpsRedirection();` entry. Otherwise the static file can not be found at runtime.
106+
107+
> **Info**: Using a wwwroot sub-folder name that starts with `'.'` , like the suggested `.auth` folder name, is useful for content relevant only for localhost debugging as these are treated as hidden folders and are not included in publish output.
106108
107109
## Authors
108110

src/KK.AspNetCore.EasyAuthAuthentication.Sample/Startup.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ public void ConfigureServices(IServiceCollection services)
4444
// Override the AuthEndpoint while developing
4545
if (this.Environment.IsDevelopment())
4646
{
47-
// The me.json should be placed in 'wwwroot/auth'
47+
// The me.json should be placed in 'wwwroot/.auth'
4848
// The Static File Handler will not work with files without extension
49-
// so the endpoint should point to a file with extension
50-
options.AuthEndpoint = "auth/me.json";
49+
// so the endpoint should point to a file with extension. Folders that
50+
// start with '.' are considered hidden folders and do not get included
51+
// in publish site output which is desirable in this case.
52+
options.AuthEndpoint = ".auth/me.json";
5153
}
5254
}
5355
);

0 commit comments

Comments
 (0)