File tree Expand file tree Collapse file tree 5 files changed +33
-19
lines changed
9.0/BlazorWebAppWinAuthServer Expand file tree Collapse file tree 5 files changed +33
-19
lines changed Original file line number Diff line number Diff line change 1+ @inject NavigationManager Navigation
2+
3+ @code {
4+ protected override void OnInitialized ()
5+ {
6+ Navigation .Refresh (forceReload : true );
7+ }
8+ }
Original file line number Diff line number Diff line change 2020 </NavLink >
2121 </div >
2222
23- <AuthorizeView >
24- <div class =" nav-item px-3" >
25- <NavLink class =" nav-link" href =" weather" >
26- <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > Weather
27- </NavLink >
28- </div >
23+ <div class =" nav-item px-3" >
24+ <NavLink class =" nav-link" href =" weather" >
25+ <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > Weather (Secure)
26+ </NavLink >
27+ </div >
2928
30- <div class =" nav-item px-3" >
31- <NavLink class =" nav-link" href =" user-claims" >
32- <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > User Claims
33- </NavLink >
34- </div >
29+ <div class =" nav-item px-3" >
30+ <NavLink class =" nav-link" href =" user-claims" >
31+ <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > User Claims (Secure)
32+ </NavLink >
33+ </div >
3534
36- <div class =" nav-item px-3" >
37- <NavLink class =" nav-link" href =" local-account-only" >
38- <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > Local Account Only
39- </NavLink >
40- </div >
41- </AuthorizeView >
35+ <div class =" nav-item px-3" >
36+ <NavLink class =" nav-link" href =" local-account" >
37+ <span class =" bi bi-list-nested-nav-menu" aria-hidden =" true" ></span > Local Account (Secure)
38+ </NavLink >
39+ </div >
4240 </nav >
4341</div >
4442
Original file line number Diff line number Diff line change 1- @page " /local-account-only "
1+ @page " /local-account"
22@using Microsoft .AspNetCore .Authorization
33@attribute [Authorize("LocalAccount")]
44
Original file line number Diff line number Diff line change 11<Router AppAssembly =" typeof(Program).Assembly" >
22 <Found Context =" routeData" >
3- <AuthorizeRouteView RouteData =" routeData" DefaultLayout =" typeof(Layout.MainLayout)" />
3+ <AuthorizeRouteView RouteData =" routeData" DefaultLayout =" typeof(Layout.MainLayout)" >
4+ <NotAuthorized >
5+ <ForceLogin />
6+ </NotAuthorized >
7+ </AuthorizeRouteView >
48 <FocusOnNavigate RouteData =" routeData" Selector =" h1" />
59 </Found >
610</Router >
Original file line number Diff line number Diff line change 77builder . Services . AddAuthentication ( NegotiateDefaults . AuthenticationScheme )
88 . AddNegotiate ( ) ;
99
10+ // To require authentication for all users for the
11+ // entire app, use the following code.
12+ /*
1013builder.Services.AddAuthorization(options =>
1114{
1215 options.FallbackPolicy = options.DefaultPolicy;
1316});
17+ */
1418
1519builder . Services . AddCascadingAuthenticationState ( ) ;
1620
You can’t perform that action at this time.
0 commit comments