Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philipmat/aspnetcorewindowsauthclaims
Claims loading in ASP.NET Core + Windows Auth
https://github.com/philipmat/aspnetcorewindowsauthclaims
Last synced: about 1 month ago
JSON representation
Claims loading in ASP.NET Core + Windows Auth
- Host: GitHub
- URL: https://github.com/philipmat/aspnetcorewindowsauthclaims
- Owner: philipmat
- License: mit
- Created: 2019-05-07T00:14:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T08:00:36.000Z (7 months ago)
- Last Synced: 2024-05-28T18:47:18.290Z (7 months ago)
- Language: C#
- Size: 1010 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AspNetCoreWindowsAuthClaims
Claims loading in ASP.NET Core + Windows AuthBased on: https://philipm.at/2018/aspnetcore_claims_with_windowsauthentication.html
and https://philipm.at/2021/cached_claims.html.## How to Run
1. Run the app;
2. Navigate to https://localhost:44323/Home/Yes ;
3. The response should read "*{YourDomain\YourUserName}*: Has cheezeburger!".### Validate the negative
Can always access https://localhost:44323/Home/No for a claim that is never set.
Also:
#### If running from Visual Studio (IISExpress)
The claims transformation is performed on each page load.
1. Put a breakpoint in `MyClaimsLoader` line 31 (`if (await ...)`);
2. Reload https://localhost:44323/Home/Yes ;
3. When the breakpoint hits, move the next line to the return (avoids setting the claim);
4. The page should respond with status 403 (Forbidden).#### If running in IIS
The claims are loaded only once per browser "session" (not ASP.NET Core session).
1. Change `MagicPowersInfoProvider` to return `false`;
2. Redeploy; close all browser windows or use a different browser;
3. Access https://localhost:44323/Home/Yes ;
4. The page should now respond with status 403 (Forbidden).