61 references to AuthenticationScheme
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
30=> builder.AddKeycloakJwtBearer(serviceName, realm, JwtBearerDefaults.AuthenticationScheme, null); 58=> builder.AddKeycloakJwtBearer(serviceName, realm, JwtBearerDefaults.AuthenticationScheme, configureOptions);
Aspire.Keycloak.Authentication.Tests (4)
AspireKeycloakExtensionTests.cs (4)
31.Get(JwtBearerDefaults.AuthenticationScheme)); 42var scheme = JwtBearerDefaults.AuthenticationScheme; 71.Get(JwtBearerDefaults.AuthenticationScheme); 82var scheme = JwtBearerDefaults.AuthenticationScheme;
JwtBearerSample (2)
Startup.cs (2)
28services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) 51var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
JwtSample (4)
Broadcaster.cs (1)
10[Authorize(JwtBearerDefaults.AuthenticationScheme)]
Startup.cs (3)
22options.AddPolicy(JwtBearerDefaults.AuthenticationScheme, policy => 24policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme); 29services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
Microsoft.AspNetCore.Authentication.JwtBearer (5)
JwtBearerExtensions.cs (4)
17/// Enables JWT-bearer authentication using the default scheme <see cref="JwtBearerDefaults.AuthenticationScheme"/>. 25=> builder.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, _ => { }); 40/// Enables JWT-bearer authentication using the default scheme <see cref="JwtBearerDefaults.AuthenticationScheme"/>. 49=> builder.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, configureOptions);
JwtBearerOptions.cs (1)
65public string Challenge { get; set; } = JwtBearerDefaults.AuthenticationScheme;
Microsoft.AspNetCore.Authentication.Test (30)
AuthenticationMiddlewareTests.cs (1)
179var options = app.Services.GetService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme);
JwtBearerTests.cs (12)
29protected override string DefaultScheme => JwtBearerDefaults.AuthenticationScheme; 419var builder = new StringBuilder(JwtBearerDefaults.AuthenticationScheme); 511options.SecurityTokenValidators.Add(new BlobTokenValidator(JwtBearerDefaults.AuthenticationScheme)); 1176var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); // this used to be "Automatic" 1191await context.ChallengeAsync(JwtBearerDefaults.AuthenticationScheme); 1212var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1213await context.ChallengeAsync(JwtBearerDefaults.AuthenticationScheme); 1218await context.ForbidAsync(JwtBearerDefaults.AuthenticationScheme); 1222await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(JwtBearerDefaults.AuthenticationScheme, new ClaimsPrincipal())); 1226await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignOutAsync(JwtBearerDefaults.AuthenticationScheme)); 1230var authenticationResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1240.ConfigureServices(services => services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options)))
JwtBearerTests_Handler.cs (17)
29protected override string DefaultScheme => JwtBearerDefaults.AuthenticationScheme; 389var builder = new StringBuilder(JwtBearerDefaults.AuthenticationScheme); 478options.TokenHandlers.Add(new BlobTokenValidator(JwtBearerDefaults.AuthenticationScheme)); 980var jwtBearerOptions = sp.GetRequiredService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme); 1021var jwtBearerOptions = sp.GetRequiredService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme); 1048var jwtBearerOptions = sp.GetRequiredService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme); 1068var jwtBearerOptions = sp.GetRequiredService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme); 1090var jwtBearerOptions = sp.GetRequiredService<IOptionsMonitor<JwtBearerOptions>>().Get(JwtBearerDefaults.AuthenticationScheme); 1243var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); // this used to be "Automatic" 1258await context.ChallengeAsync(JwtBearerDefaults.AuthenticationScheme); 1279var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1280await context.ChallengeAsync(JwtBearerDefaults.AuthenticationScheme); 1285await context.ForbidAsync(JwtBearerDefaults.AuthenticationScheme); 1289await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignInAsync(JwtBearerDefaults.AuthenticationScheme, new ClaimsPrincipal())); 1293await Assert.ThrowsAsync<InvalidOperationException>(() => context.SignOutAsync(JwtBearerDefaults.AuthenticationScheme)); 1297var authenticationResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1307.ConfigureServices(services => services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(options)))
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
3201options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; 3202options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; 3957[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (5)
Hubs.cs (1)
316[Authorize(JwtBearerDefaults.AuthenticationScheme)]
Startup.cs (4)
38options.AddPolicy(JwtBearerDefaults.AuthenticationScheme, policy => 40policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme); 51services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) 101.RequireAuthorization(new AuthorizeAttribute(JwtBearerDefaults.AuthenticationScheme));
Microsoft.AspNetCore.SignalR.Tests (2)
Startup.cs (2)
37options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; 38options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
SignalR.Client.FunctionalTestApp (4)
AuthorizedHub.cs (1)
10[Authorize(JwtBearerDefaults.AuthenticationScheme)]
Startup.cs (3)
49options.AddPolicy(JwtBearerDefaults.AuthenticationScheme, policy => 51policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme); 56services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)