106 references to AuthenticationScheme
ClaimsTransformation (2)
Controllers\AccountController.cs (1)
42await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme, "user", "role")));
Startup.cs (1)
33services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) // Sets the default scheme to cookies
CookiePolicySample (2)
Startup.cs (2)
15services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 44CookieAuthenticationDefaults.AuthenticationScheme));
CookieSample (3)
Program.cs (3)
12.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 43var user = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, "bob") }, CookieAuthenticationDefaults.AuthenticationScheme)); 44await context.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, user);
CookieSessionSample (5)
Startup.cs (5)
17options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; 18options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme; 22services.AddOptions<CookieAuthenticationOptions>(CookieAuthenticationDefaults.AuthenticationScheme) 42await context.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, 43new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme)));
CustomPolicyProvider (1)
Startup.cs (1)
29services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
Microsoft.AspNetCore.Authentication.Cookies (4)
CookieExtensions.cs (4)
18/// The default scheme is specified by <see cref="CookieAuthenticationDefaults.AuthenticationScheme"/>. 26=> builder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme); 42/// The default scheme is specified by <see cref="CookieAuthenticationDefaults.AuthenticationScheme"/>. 51=> builder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, configureOptions);
Microsoft.AspNetCore.Authentication.Test (56)
CookieTests.cs (26)
27protected override string DefaultScheme => CookieAuthenticationDefaults.AuthenticationScheme; 191s.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(o => 226s.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(o => 293Assert.Throws<OptionsValidationException>(() => options.Get(CookieAuthenticationDefaults.AuthenticationScheme)); 1277await Assert.ThrowsAsync<InvalidOperationException>(() => context.ChallengeAsync(CookieAuthenticationDefaults.AuthenticationScheme)); 1299app.Run(context => context.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity("whatever")))); 1304services.Configure<CookieAuthenticationOptions>(CookieAuthenticationDefaults.AuthenticationScheme, 1507CookieAuthenticationDefaults.AuthenticationScheme, 1508new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme))), 1531CookieAuthenticationDefaults.AuthenticationScheme, 1532new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme)))); 1553CookieAuthenticationDefaults.AuthenticationScheme, 1554new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme)))); 1576CookieAuthenticationDefaults.AuthenticationScheme, 1577new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme)))); 1598CookieAuthenticationDefaults.AuthenticationScheme, 1599new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice", CookieAuthenticationDefaults.AuthenticationScheme))), 1713CookieAuthenticationDefaults.AuthenticationScheme, 1796s.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(o => 1826await context.ForbidAsync(CookieAuthenticationDefaults.AuthenticationScheme); 1830await context.ChallengeAsync(CookieAuthenticationDefaults.AuthenticationScheme); 1838await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); 1842await context.ChallengeAsync(CookieAuthenticationDefaults.AuthenticationScheme, new AuthenticationProperties()); 1846await context.ChallengeAsync(CookieAuthenticationDefaults.AuthenticationScheme, new AuthenticationProperties() { RedirectUri = "/CustomRedirect" }); 1850await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, new AuthenticationProperties(), CookieAuthenticationDefaults.AuthenticationScheme))); 1863var result = await context.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme); // this used to be "Automatic"
FacebookTests.cs (1)
321services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
OAuthTests.cs (5)
284o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 300opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 327opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 362opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 398opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
OpenIdConnect\OpenIdConnectEventTests.cs (1)
1273auth.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
1273auth.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
OpenIdConnect\OpenIdConnectTests.cs (9)
38opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 65opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 90opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 118opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 143opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 173opt.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 306o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 330o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 353o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
OpenIdConnect\TestServerBuilder.cs (1)
113services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
WsFederation\WsFederationTest.cs (6)
51sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 52sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 211sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 212sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 284sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 285sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
WsFederation\WsFederationTest_Handler.cs (6)
49sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 50sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 209sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 210sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 282sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 283sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
Microsoft.AspNetCore.CookiePolicy.Test (2)
CookiePolicyTests.cs (2)
375return context.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, 426return context.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
3296services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 3363services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
OpenIdConnectSample (4)
Startup.cs (4)
95sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 163await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); 175await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); 195await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
PathSchemeSelection (2)
Controllers\AccountController.cs (1)
42await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role")));
Startup.cs (1)
26services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
RazorPagesWebSite (4)
Startup.cs (1)
12services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithBasePath.cs (1)
20services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithClientValidationDisabled.cs (1)
13services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithoutEndpointRouting.cs (1)
14services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => options.LoginPath = "/Login");
SecurityWebSite (12)
Controllers\LoginController.cs (5)
18var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value") }, CookieAuthenticationDefaults.AuthenticationScheme); 26var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value") }, CookieAuthenticationDefaults.AuthenticationScheme); 27await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity)); 34var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value"), new Claim("ClaimB", "Value") }, CookieAuthenticationDefaults.AuthenticationScheme); 35await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity));
Startup.cs (1)
17services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
StartupWithGlobalAuthFilter.cs (1)
14.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithGlobalAuthFilterWithoutEndpointRouting.cs (1)
14.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithGlobalDenyAnonymousFilter.cs (1)
15.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithGlobalDenyAnonymousFilterWithUseMvc.cs (1)
15.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
StartupWithRequireAuth.cs (1)
17services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
StartupWithUseMvc.cs (1)
17services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
SocialSample (2)
Startup.cs (2)
41services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 400await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
StaticFilesAuth (1)
Startup.cs (1)
25services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
WsFedSample (4)
Startup.cs (4)
25sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; 26sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 58await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); 70await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);