122 references to CookieAuthenticationDefaults
Aspire.Dashboard (8)
DashboardEndpointsBuilder.cs (2)
79
CookieAuthenticationDefaults
.AuthenticationScheme).ConfigureAwait(false);
86
endpoints.MapPost("/authentication/logout", () => TypedResults.SignOut(authenticationSchemes: [
CookieAuthenticationDefaults
.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme]));
DashboardWebApplication.cs (4)
733
o.ForwardDefault =
CookieAuthenticationDefaults
.AuthenticationScheme;
747
options.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
771
o.ForwardDefault =
CookieAuthenticationDefaults
.AuthenticationScheme;
838
_ =>
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;
198
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
233
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
300
Assert.Throws<OptionsValidationException>(() => options.Get(
CookieAuthenticationDefaults
.AuthenticationScheme));
1284
await Assert.ThrowsAsync<InvalidOperationException>(() => context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme));
1306
app.Run(context => context.SignInAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity("whatever"))));
1311
services.Configure<CookieAuthenticationOptions>(
CookieAuthenticationDefaults
.AuthenticationScheme,
1514
CookieAuthenticationDefaults
.AuthenticationScheme,
1515
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))),
1538
CookieAuthenticationDefaults
.AuthenticationScheme,
1539
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1560
CookieAuthenticationDefaults
.AuthenticationScheme,
1561
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1583
CookieAuthenticationDefaults
.AuthenticationScheme,
1584
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))));
1605
CookieAuthenticationDefaults
.AuthenticationScheme,
1606
new ClaimsPrincipal(new ClaimsIdentity(new GenericIdentity("Alice",
CookieAuthenticationDefaults
.AuthenticationScheme))),
1720
CookieAuthenticationDefaults
.AuthenticationScheme,
1803
s.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme).AddCookie(o =>
1833
await context.ForbidAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1837
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1845
await context.SignOutAsync(
CookieAuthenticationDefaults
.AuthenticationScheme);
1849
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new AuthenticationProperties());
1853
await context.ChallengeAsync(
CookieAuthenticationDefaults
.AuthenticationScheme, new AuthenticationProperties() { RedirectUri = "/CustomRedirect" });
1857
await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, new AuthenticationProperties(),
CookieAuthenticationDefaults
.AuthenticationScheme)));
1870
var result = await context.AuthenticateAsync(
CookieAuthenticationDefaults
.AuthenticationScheme); // this used to be "Automatic"
FacebookTests.cs (1)
328
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
OAuthTests.cs (5)
291
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
307
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
334
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
369
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
405
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)
45
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
72
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
97
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
125
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
150
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
180
opt.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
313
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
337
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
360
o.SignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
OpenIdConnect\TestServerBuilder.cs (1)
113
services.AddAuthentication(
CookieAuthenticationDefaults
.AuthenticationScheme)
WsFederation\WsFederationTest.cs (6)
58
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
59
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
218
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
219
sharedOptions.DefaultSignInScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
291
sharedOptions.DefaultScheme =
CookieAuthenticationDefaults
.AuthenticationScheme;
292
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);