87 instantiations of AuthenticationTicket
Aspire.Dashboard (3)
Authentication\AspirePolicyEvaluator.cs (2)
68var ticket = new AuthenticationTicket(newPrincipal, string.Join(';', policy.AuthenticationSchemes)); 87? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User"))
Authentication\UnsecuredAuthenticationHandler.cs (1)
23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)));
BasicWebSite (1)
BasicAuthenticationHandler.cs (1)
34return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(
CustomAuthorizationFailureResponse (1)
Authentication\SampleAuthenticationHandler.cs (1)
21=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
Microsoft.AspNetCore.Authentication (4)
Events\RemoteAuthenticationContext.cs (1)
42public void Success() => Result = HandleRequestResult.Success(new AuthenticationTicket(Principal!, Properties, Scheme.Name));
Events\ResultContext.cs (1)
51public void Success() => Result = HandleRequestResult.Success(new AuthenticationTicket(Principal!, Properties, Scheme.Name));
RemoteAuthenticationHandler.cs (1)
208return AuthenticateResult.Success(new AuthenticationTicket(ticket.Principal,
TicketSerializer.cs (1)
173return new AuthenticationTicket(new ClaimsPrincipal(identities), properties, scheme);
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationTicket.cs (1)
66return new AuthenticationTicket(principal, Properties.Clone(), AuthenticationScheme);
Microsoft.AspNetCore.Authentication.BearerToken (2)
BearerTokenHandler.cs (2)
104=> new(user, properties, $"{Scheme.Name}:AccessToken"); 113return new AuthenticationTicket(user, refreshProperties, $"{Scheme.Name}:RefreshToken");
Microsoft.AspNetCore.Authentication.Cookies (5)
CookieAuthenticationHandler.cs (5)
147return new AuthenticationTicket(newPrincipal, newProperties, ticket.AuthenticationScheme); 226return AuthenticateResult.Success(new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name)); 269ticket = new AuthenticationTicket(principal, null, Scheme.Name); 335var ticket = new AuthenticationTicket(signInContext.Principal!, signInContext.Properties, signInContext.Scheme.Name); 353ticket = new AuthenticationTicket(principal, null, Scheme.Name);
Microsoft.AspNetCore.Authentication.Core (1)
AuthenticationService.cs (1)
95return AuthenticateResult.Success(new AuthenticationTicket(principal, result.Properties, result.Ticket!.AuthenticationScheme));
Microsoft.AspNetCore.Authentication.Core.Test (3)
AuthenticationServiceTests.cs (1)
258new AuthenticationTicket(
AuthenticationTicketTests.cs (1)
25var ticket = new AuthenticationTicket(principal, props, "scheme");
TokenExtensionTests.cs (1)
165return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), props, "simple")));
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
63return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
61return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
57return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
374var ticket = new AuthenticationTicket(authenticatedContext.Principal, authenticatedContext.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
258return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.OpenIdConnect (4)
OpenIdConnectHandler.cs (4)
926return HandleRequestResult.Success(new AuthenticationTicket(user, properties, Scheme.Name)); 1049return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name)); 1054return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name)); 1106return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name));
Microsoft.AspNetCore.Authentication.Test (14)
AuthenticationMiddlewareTests.cs (4)
65.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 108.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 134.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 151var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), "");
CookieTests.cs (1)
1850await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, new AuthenticationProperties(), CookieAuthenticationDefaults.AuthenticationScheme)));
DynamicSchemeTests.cs (1)
125return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name)));
PolicyTests.cs (2)
377return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 427return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name)));
TestHandlers.cs (2)
42return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 74return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name)));
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");
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
160return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationHandler.cs (1)
349return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name));
Microsoft.AspNetCore.Authorization.Policy (2)
PolicyEvaluator.cs (2)
57var ticket = new AuthenticationTicket(newPrincipal, string.Join(';', policy.AuthenticationSchemes)); 76? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User"))
Microsoft.AspNetCore.Authorization.Test (11)
AuthorizationMiddlewareTests.cs (6)
829var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 836var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 903var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), ""); 925var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 932var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "")); 958var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), ""));
PolicyEvaluatorTests.cs (4)
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); 212return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(Principal, scheme)));
TestObjects\TestAuthenticationService.cs (1)
27return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(identity), scheme)));
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
360await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, null, "Application")));
Microsoft.AspNetCore.Identity.Test (20)
SecurityStampValidatorTest.cs (7)
63var ticket = new AuthenticationTicket(id, new AuthenticationProperties { IssuedUtc = DateTimeOffset.UtcNow }, IdentityConstants.ApplicationScheme); 82var ticket = new AuthenticationTicket(principal, 140var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 181var ticket = new AuthenticationTicket(new ClaimsPrincipal(tid), 223var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 260var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 298var ticket = new AuthenticationTicket(new ClaimsPrincipal(id),
SignInManagerTest.cs (13)
217.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), null, IdentityConstants.TwoFactorRememberMeScheme))).Verifiable(); 376.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 417.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 456.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 546.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 701.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 736.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 793.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), null, IdentityConstants.TwoFactorRememberMeScheme))).Verifiable(); 1041var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1072var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1104var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1202.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 1268.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable();
Microsoft.AspNetCore.Mvc.Core.Test (2)
Authorization\AuthorizeFilterTest.cs (2)
612auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Bearer")).ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(bearerPrincipal, "Bearer"))); 613auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Basic")).ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(basicPrincipal, "Basic")));
Microsoft.AspNetCore.Server.HttpSys (1)
AuthenticationHandler.cs (1)
19return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_requestContext.User!, properties: null, authenticationScheme: _scheme!.Name)));
Microsoft.AspNetCore.Server.IIS (1)
Core\IISServerAuthenticationHandlerInternal.cs (1)
30return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(user, Scheme.Name)));
Microsoft.AspNetCore.Server.IISIntegration (1)
AuthenticationHandler.cs (1)
23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_user, _scheme.Name)));
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
2867new AuthenticationTicket(principal, "custom")));
PathSchemeSelection (1)
Startup.cs (1)
52=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
92 references to AuthenticationTicket
Aspire.Dashboard (1)
Authentication\AspirePolicyEvaluator.cs (1)
68var ticket = new AuthenticationTicket(newPrincipal, string.Join(';', policy.AuthenticationSchemes));
CookieSessionSample (4)
MemoryCacheTicketStore.cs (4)
20public async Task<string> StoreAsync(AuthenticationTicket ticket) 28public Task RenewAsync(string key, AuthenticationTicket ticket) 43public Task<AuthenticationTicket> RetrieveAsync(string key) 45AuthenticationTicket ticket;
Microsoft.AspNetCore.Authentication (16)
AuthenticationHandler.cs (1)
227var ticket = result.Ticket;
Events\TicketReceivedContext.cs (1)
24AuthenticationTicket ticket)
HandleRequestResult.cs (1)
32public static new HandleRequestResult Success(AuthenticationTicket ticket)
RemoteAuthenticationHandler.cs (2)
82AuthenticationTicket? ticket = null; 203var ticket = result.Ticket;
TicketDataFormat.cs (2)
10/// <see cref="AuthenticationTicket"/>. 12public class TicketDataFormat : SecureDataFormat<AuthenticationTicket>
TicketSerializer.cs (9)
11/// Serializes and deserializes <see cref="AuthenticationTicket"/> instances. 13public class TicketSerializer : IDataSerializer<AuthenticationTicket> 24public virtual byte[] Serialize(AuthenticationTicket ticket) 37public virtual AuthenticationTicket? Deserialize(byte[] data) 52/// <param name="ticket">The <see cref="AuthenticationTicket"/>.</param> 53public virtual void Write(BinaryWriter writer, AuthenticationTicket ticket) 142/// Reads an <see cref="AuthenticationTicket"/>. 145/// <returns>The <see cref="AuthenticationTicket"/> if the format is supported, otherwise <see langword="null"/>.</returns> 146public virtual AuthenticationTicket? Read(BinaryReader reader)
Microsoft.AspNetCore.Authentication.Abstractions (5)
AuthenticateResult.cs (2)
30public AuthenticationTicket? Ticket { get; protected set; } 79public static AuthenticateResult Success(AuthenticationTicket ticket)
AuthenticationTicket.cs (3)
14/// Initializes a new instance of the <see cref="AuthenticationTicket"/> class 29/// Initializes a new instance of the <see cref="AuthenticationTicket"/> class 59public AuthenticationTicket Clone()
Microsoft.AspNetCore.Authentication.BearerToken (6)
BearerTokenHandler.cs (2)
103private AuthenticationTicket CreateBearerTicket(ClaimsPrincipal user, AuthenticationProperties properties) 106private AuthenticationTicket CreateRefreshTicket(ClaimsPrincipal user, DateTimeOffset utcNow)
BearerTokenOptions.cs (4)
13private ISecureDataFormat<AuthenticationTicket>? _bearerTokenProtector; 14private ISecureDataFormat<AuthenticationTicket>? _refreshTokenProtector; 48public ISecureDataFormat<AuthenticationTicket> BearerTokenProtector 59public ISecureDataFormat<AuthenticationTicket> RefreshTokenProtector
Microsoft.AspNetCore.Authentication.Cookies (20)
CookieAuthenticationHandler.cs (8)
34private AuthenticationTicket? _refreshTicket; 92private async Task CheckForRefreshAsync(AuthenticationTicket ticket) 116private void RequestRefresh(AuthenticationTicket ticket, ClaimsPrincipal? replacedPrincipal = null) 132private static AuthenticationTicket CloneTicket(AuthenticationTicket ticket, ClaimsPrincipal? replacedPrincipal) 158var ticket = Options.TicketDataFormat.Unprotect(cookie, GetTlsTokenBinding()); 247var ticket = _refreshTicket; 335var ticket = new AuthenticationTicket(signInContext.Principal!, signInContext.Properties, signInContext.Scheme.Name);
CookieAuthenticationOptions.cs (1)
109public ISecureDataFormat<AuthenticationTicket> TicketDataFormat { get; set; } = default!;
CookieSlidingExpirationContext.cs (1)
23AuthenticationTicket ticket, TimeSpan elapsedTime, TimeSpan remainingTime)
CookieValidatePrincipalContext.cs (1)
21public CookieValidatePrincipalContext(HttpContext context, AuthenticationScheme scheme, CookieAuthenticationOptions options, AuthenticationTicket ticket)
ITicketStore.cs (9)
20Task<string> StoreAsync(AuthenticationTicket ticket); 28Task<string> StoreAsync(AuthenticationTicket ticket, CancellationToken cancellationToken) => StoreAsync(ticket); 37Task<string> StoreAsync(AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => StoreAsync(ticket, cancellationToken); 45Task RenewAsync(string key, AuthenticationTicket ticket); 54Task RenewAsync(string key, AuthenticationTicket ticket, CancellationToken cancellationToken) => RenewAsync(key, ticket); 64Task RenewAsync(string key, AuthenticationTicket ticket, HttpContext httpContext, CancellationToken cancellationToken) => RenewAsync(key, ticket, cancellationToken); 71Task<AuthenticationTicket?> RetrieveAsync(string key); 79Task<AuthenticationTicket?> RetrieveAsync(string key, CancellationToken cancellationToken) => RetrieveAsync(key); 88Task<AuthenticationTicket?> RetrieveAsync(string key, HttpContext httpContext, CancellationToken cancellationToken) => RetrieveAsync(key, cancellationToken);
Microsoft.AspNetCore.Authentication.Core.Test (2)
AuthenticationTicketTests.cs (2)
25var ticket = new AuthenticationTicket(principal, props, "scheme"); 29var copy = ticket.Clone();
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
40protected override async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
41protected override async Task<AuthenticationTicket> CreateTicketAsync(
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
41protected override async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
374var ticket = new AuthenticationTicket(authenticatedContext.Principal, authenticatedContext.Properties, Scheme.Name);
Microsoft.AspNetCore.Authentication.OAuth (4)
OAuthHandler.cs (4)
182var ticket = await CreateTicketAsync(identity, properties, tokens); 246/// Creates an <see cref="AuthenticationTicket"/> from the specified <paramref name="tokens"/>. 251/// <returns>The <see cref="AuthenticationTicket"/>.</returns> 252protected virtual async Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)
Microsoft.AspNetCore.Authentication.Test (15)
AuthenticationMiddlewareTests.cs (1)
151var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), "");
CookieTests.cs (6)
154public readonly Dictionary<string, AuthenticationTicket> Store = new Dictionary<string, AuthenticationTicket>(); 156public async Task<string> StoreAsync(AuthenticationTicket ticket) 164public Task RenewAsync(string key, AuthenticationTicket ticket) 171public Task<AuthenticationTicket> RetrieveAsync(string key) 173AuthenticationTicket ticket;
TicketSerializerTests.cs (8)
17var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 25var readTicket = serializer.Read(reader); 38var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 47var readTicket = serializer.Read(reader); 61var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 70var readTicket = serializer.Read(reader); 96var ticket = new AuthenticationTicket(new ClaimsPrincipal(), properties, "Hello"); 105var readTicket = serializer.Read(reader);
Microsoft.AspNetCore.Authentication.Twitter (4)
TwitterHandler.cs (4)
136var ticket = await CreateTicketAsync(identity, properties, accessToken, user.RootElement); 142/// Creates an <see cref="AuthenticationTicket"/> from the specified <paramref name="token"/>. 148/// <returns>The <see cref="AuthenticationTicket"/>.</returns> 149protected virtual async Task<AuthenticationTicket> CreateTicketAsync(
Microsoft.AspNetCore.Authorization.Policy (1)
PolicyEvaluator.cs (1)
57var ticket = new AuthenticationTicket(newPrincipal, string.Join(';', policy.AuthenticationSchemes));
Microsoft.AspNetCore.Authorization.Test (1)
AuthorizationMiddlewareTests.cs (1)
903var newTicket = new AuthenticationTicket(new ClaimsPrincipal(), "");
Microsoft.AspNetCore.Identity (1)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
127var refreshTicket = refreshTokenProtector.Unprotect(refreshRequest.RefreshToken);
Microsoft.AspNetCore.Identity.Test (8)
SecurityStampValidatorTest.cs (8)
63var ticket = new AuthenticationTicket(id, new AuthenticationProperties { IssuedUtc = DateTimeOffset.UtcNow }, IdentityConstants.ApplicationScheme); 82var ticket = new AuthenticationTicket(principal, 140var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 181var ticket = new AuthenticationTicket(new ClaimsPrincipal(tid), 223var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 260var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 298var ticket = new AuthenticationTicket(new ClaimsPrincipal(id), 347var ticket = new AuthenticationTicket(principal,