122 references to CookieAuthenticationDefaults
Aspire.Dashboard (8)
DashboardEndpointsBuilder.cs (2)
32
CookieAuthenticationDefaults
.AuthenticationScheme).ConfigureAwait(false);
39
endpoints.MapPost("/authentication/logout", () => TypedResults.SignOut(authenticationSchemes: [
CookieAuthenticationDefaults
.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme]));
DashboardWebApplication.cs (4)
704
o.ForwardDefault =
CookieAuthenticationDefaults
.AuthenticationScheme;
718
options.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
742
o.ForwardDefault =
CookieAuthenticationDefaults
.AuthenticationScheme;
809
_ =>
CookieAuthenticationDefaults
.AuthenticationScheme
Model\ValidateTokenMiddleware.cs (2)
95
authenticationType:
CookieAuthenticationDefaults
.AuthenticationScheme);
99
CookieAuthenticationDefaults
.AuthenticationScheme,
ClaimsTransformation (2)
Controllers\AccountController.cs (1)
42
await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims,
CookieAuthenticationDefaults
.AuthenticationScheme, "user", "role")));
Startup.cs (1)
33
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme) // Sets the default scheme to cookies
CookiePolicySample (2)
Startup.cs (2)
15
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
44
CookieAuthenticationDefaults
.AuthenticationScheme));
CookieSample (3)
Program.cs (3)
12
.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
43
var user = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, "bob") },
CookieAuthenticationDefaults
.AuthenticationScheme));
44
await context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, user);
CookieSessionSample (5)
Startup.cs (5)
17
options.DefaultAuthenticateScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
18
options.DefaultChallengeScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
22
services.AddOptions<CookieAuthenticationOptions>(
CookieAuthenticationDefaults
.AuthenticationScheme)
42
await context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme,
43
new ClaimsPrincipal(new ClaimsIdentity(claims,
CookieAuthenticationDefaults
.AuthenticationScheme)));
CustomPolicyProvider (1)
Startup.cs (1)
29
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
Keycloak.Web (3)
LoginLogoutEndpointRouteBuilderExtensions.cs (1)
17
[
CookieAuthenticationDefaults
.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme]));
Program.cs (2)
41
options.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
43
.AddCookie(
CookieAuthenticationDefaults
.AuthenticationScheme);
Microsoft.AspNetCore.Authentication.Cookies (9)
CookieAuthenticationOptions.cs (1)
31
ReturnUrlParameter =
CookieAuthenticationDefaults
.ReturnUrlParameter;
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);
PostConfigureCookieAuthenticationOptions.cs (4)
38
options.Cookie.Name =
CookieAuthenticationDefaults
.CookiePrefix + Uri.EscapeDataString(name);
52
options.LoginPath =
CookieAuthenticationDefaults
.LoginPath;
56
options.LogoutPath =
CookieAuthenticationDefaults
.LogoutPath;
60
options.AccessDeniedPath =
CookieAuthenticationDefaults
.AccessDeniedPath;
Microsoft.AspNetCore.Authentication.Test (56)
CookieTests.cs (26)
27
protected override string DefaultScheme =>
CookieAuthenticationDefaults
.AuthenticationScheme;
191
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
226
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
293
Assert.Throws<OptionsValidationException>(() => options.Get(
CookieAuthenticationDefaults
.AuthenticationScheme));
1277
await Assert.ThrowsAsync<InvalidOperationException>(() => context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme));
1299
app.Run(context => context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity("whatever"))));
1304
services.Configure<CookieAuthenticationOptions>(
CookieAuthenticationDefaults
.AuthenticationScheme,
1507
CookieAuthenticationDefaults
.AuthenticationScheme,
1508
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))),
1531
CookieAuthenticationDefaults
.AuthenticationScheme,
1532
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1553
CookieAuthenticationDefaults
.AuthenticationScheme,
1554
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1576
CookieAuthenticationDefaults
.AuthenticationScheme,
1577
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1598
CookieAuthenticationDefaults
.AuthenticationScheme,
1599
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))),
1713
CookieAuthenticationDefaults
.AuthenticationScheme,
1796
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
1826
await context.ForbidAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1830
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1838
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1842
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new AuthenticationProperties());
1846
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new AuthenticationProperties() { RedirectUri = "/CustomRedirect" });
1850
await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, new AuthenticationProperties(),
CookieAuthenticationDefaults
.AuthenticationScheme)));
1863
var result = await context.AuthenticateAsync(
CookieAuthenticationDefaults
.AuthenticationScheme); // this used to be "Automatic"
FacebookTests.cs (1)
321
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
OAuthTests.cs (5)
284
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
300
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
327
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
362
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
398
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
OpenIdConnect\OpenIdConnectEventTests.cs (1)
1273
auth.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
1273
auth.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
OpenIdConnect\OpenIdConnectTests.cs (9)
38
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
65
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
90
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
118
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
143
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
173
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
306
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
330
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
353
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
OpenIdConnect\TestServerBuilder.cs (1)
113
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
WsFederation\WsFederationTest.cs (6)
51
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
52
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
211
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
212
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
284
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
285
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
WsFederation\WsFederationTest_Handler.cs (6)
49
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
50
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
209
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
210
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
282
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
283
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
Microsoft.AspNetCore.CookiePolicy.Test (2)
CookiePolicyTests.cs (2)
375
return context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme,
426
return context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme,
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
3296
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
3363
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
OpenIdConnectSample (4)
Startup.cs (4)
95
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
163
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
175
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
195
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
PathSchemeSelection (2)
Controllers\AccountController.cs (1)
42
await HttpContext.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role")));
Startup.cs (1)
26
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
RazorPagesWebSite (4)
Startup.cs (1)
12
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
StartupWithBasePath.cs (1)
20
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
StartupWithClientValidationDisabled.cs (1)
13
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
StartupWithoutEndpointRouting.cs (1)
14
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(options => options.LoginPath = "/Login");
SecurityWebSite (12)
Controllers\LoginController.cs (5)
18
var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value") },
CookieAuthenticationDefaults
.AuthenticationScheme);
26
var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value") },
CookieAuthenticationDefaults
.AuthenticationScheme);
27
await HttpContext.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new ClaimsPrincipal(identity));
34
var identity = new ClaimsIdentity(new[] { new Claim("ClaimA", "Value"), new Claim("ClaimB", "Value") },
CookieAuthenticationDefaults
.AuthenticationScheme);
35
await HttpContext.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new ClaimsPrincipal(identity));
Startup.cs (1)
17
services.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)
17
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(options =>
StartupWithUseMvc.cs (1)
17
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(options =>
SocialSample (2)
Startup.cs (2)
41
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
400
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
StaticFilesAuth (1)
Startup.cs (1)
25
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
WsFedSample (4)
Startup.cs (4)
25
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
26
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
58
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
70
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);