93 references to ClaimsPrincipal
Aspire.Dashboard (1)
Authentication\AspirePolicyEvaluator.cs (1)
134var newPrincipal = new ClaimsPrincipal();
BasicWebSite (1)
BasicAuthenticationHandler.cs (1)
24var principal = new ClaimsPrincipal();
ClaimsTransformation (1)
ClaimsTransformer.cs (1)
17var transformed = new ClaimsPrincipal();
Microsoft.AspNetCore.Authentication (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationTicket.cs (1)
61var principal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
135var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authentication.Core.Test (4)
AuthenticationServiceTests.cs (3)
91var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync("signin", new ClaimsPrincipal(), null)); 106await context.SignInAsync("signin", new ClaimsPrincipal(), null); 249return Task.FromResult(new ClaimsPrincipal());
TokenExtensionTests.cs (1)
165return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), props, "simple")));
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
471return Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal()));
Microsoft.AspNetCore.Authentication.Test (30)
AuthenticationMiddlewareTests.cs (5)
65.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 108.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 125context.User = new ClaimsPrincipal(); 134.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 151var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), "");
DynamicSchemeTests.cs (1)
117var principal = new ClaimsPrincipal();
GoogleTests.cs (1)
1206await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync("Google", new ClaimsPrincipal()));
JwtBearerTests.cs (1)
1222await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(JwtBearerDefaults.AuthenticationScheme, new ClaimsPrincipal()));
JwtBearerTests_Handler.cs (1)
1289await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(JwtBearerDefaults.AuthenticationScheme, new ClaimsPrincipal()));
MicrosoftAccountTests.cs (1)
398await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync("Microsoft", new ClaimsPrincipal()));
OpenIdConnect\OpenIdConnectConfigurationTests.cs (5)
68await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 97await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 301await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 356await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 416await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal()));
OpenIdConnect\TestServerBuilder.cs (1)
89await context.SignInAsync(OpenIdConnectDefaults.AuthenticationScheme, new ClaimsPrincipal());
PolicyTests.cs (2)
373var principal = new ClaimsPrincipal(); 423var principal = new ClaimsPrincipal();
SharedAuthenticationTests.cs (5)
77await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 211return Task.FromResult(new ClaimsPrincipal()); 377await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 446await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal())); 520await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(new ClaimsPrincipal()));
TestHandlers.cs (2)
38var principal = new ClaimsPrincipal(); 70var principal = new ClaimsPrincipal();
TicketSerializerTests.cs (4)
17var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 38var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 61var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 96var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello");
TwitterTests.cs (1)
549await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync("Twitter", new ClaimsPrincipal()));
Microsoft.AspNetCore.Authorization.Policy (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authorization.Test (22)
AuthorizationMiddlewareTests.cs (4)
877context.User = new ClaimsPrincipal(); 903var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), ""); 932var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "")); 958var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), ""));
DefaultAuthorizationServiceTests.cs (14)
107var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 134var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 185var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 340var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "whatever", "BogusPolicy")); 646var user = new ClaimsPrincipal(); 667var user = new ClaimsPrincipal(); 708var user = new ClaimsPrincipal(); 933var user = new ClaimsPrincipal(); 950var user = new ClaimsPrincipal(); 967var user = new ClaimsPrincipal(); 986var user = new ClaimsPrincipal(); 1025var user = new ClaimsPrincipal(); 1208var user = new ClaimsPrincipal(); 1242var user = new ClaimsPrincipal();
PassThroughAuthorizationHandlerTests.cs (1)
41var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Self");
PolicyEvaluatorTests.cs (3)
92var success = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "whatever")); 129var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "scheme")), context, resource: null); 149var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "scheme")), context, resource: null);
Microsoft.AspNetCore.Components.Authorization.Tests (2)
AuthorizeViewTest.cs (2)
273authTcs.SetResult(new AuthenticationState(new ClaimsPrincipal())); 524= Task.FromResult(new AuthenticationState(new ClaimsPrincipal()));
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\ServerAuthenticationStateProviderTest.cs (1)
23var user = new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Connections (2)
Internal\HttpConnectionDispatcher.cs (1)
690newContext.User = new ClaimsPrincipal();
src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Extensions.Tests (5)
RequestDelegateFactoryTests.cs (1)
1247httpContext.User = new ClaimsPrincipal();
RequestDelegateGenerator\RequestDelegateCreationTests.SpecialTypes.cs (4)
78var user = new ClaimsPrincipal(); 143httpContext.User = new ClaimsPrincipal(); 247httpContext.User = new ClaimsPrincipal(); 279httpContext.User = new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Results.Tests (7)
ResultsTests.cs (2)
456var principal = new ClaimsPrincipal(); 1774(() => Results.SignIn(new(), null, null), typeof(SignInHttpResult)),
SignInResultTests.cs (4)
19var principal = new ClaimsPrincipal(); 40var principal = new ClaimsPrincipal(); 60var principal = new ClaimsPrincipal(); 81var result = new SignInHttpResult(new());
TypedResultsTests.cs (1)
466var principal = new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Tests (1)
DefaultHttpContextTests.cs (1)
96context.User = new ClaimsPrincipal();
Microsoft.AspNetCore.Identity.Test (1)
SecurityStampValidatorTest.cs (1)
171claimsManager.Setup(c => c.CreateAsync(user)).ReturnsAsync(new ClaimsPrincipal()).Verifiable();
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Mvc.Core.Test (4)
Authorization\AuthorizeFilterTest.cs (1)
90authorizationContext.HttpContext.User = new ClaimsPrincipal();
SignInResultTest.cs (3)
22var principal = new ClaimsPrincipal(); 49var principal = new ClaimsPrincipal(); 76var principal = new ClaimsPrincipal();
Microsoft.AspNetCore.Shared.Tests (3)
SecurityHelperTests.cs (2)
16var user = SecurityHelper.MergeUserPrincipal(new ClaimsPrincipal(), new GenericPrincipal(new GenericIdentity("Test1", "Alpha"), new string[0])); 62var newPrincipal = new ClaimsPrincipal();
src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.SignalR.Core (1)
HubConnectionContext.cs (1)
139_user = Features.Get<IConnectionUserFeature>()?.User ?? new ClaimsPrincipal();
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
2862var principal = new ClaimsPrincipal();