51 references to FrontendAuthMode
Aspire.Dashboard (25)
Authentication\FrontendCompositeAuthenticationHandler.cs (2)
48FrontendAuthMode.OpenIdConnect => FrontendAuthenticationDefaults.AuthenticationSchemeOpenIdConnect, 49FrontendAuthMode.BrowserToken => FrontendAuthenticationDefaults.AuthenticationSchemeBrowserToken,
Components\Controls\UserProfile.razor.cs (1)
42if (DashboardOptions.CurrentValue.Frontend.AuthMode == FrontendAuthMode.OpenIdConnect)
Configuration\DashboardOptions.cs (1)
156public FrontendAuthMode? AuthMode { get; set; }
Configuration\PostConfigureDashboardOptions.cs (3)
49options.Frontend.AuthMode = FrontendAuthMode.Unsecured; 54options.Frontend.AuthMode ??= FrontendAuthMode.BrowserToken; 57if (options.Frontend.AuthMode == FrontendAuthMode.BrowserToken && string.IsNullOrEmpty(options.Frontend.BrowserToken))
Configuration\ValidateDashboardOptions.cs (4)
36case FrontendAuthMode.Unsecured: 38case FrontendAuthMode.OpenIdConnect: 44case FrontendAuthMode.BrowserToken: 51errorMessages.Add($"Frontend endpoint authentication is not configured. Either specify {DashboardConfigNames.DashboardUnsecuredAllowAnonymousName.ConfigKey}=true, or specify {DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey}. Possible values: {string.Join(", ", typeof(FrontendAuthMode).GetEnumNames())}");
DashboardEndpointsBuilder.cs (2)
19if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 37else if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.OpenIdConnect)
DashboardWebApplication.cs (9)
332if (options.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 700case FrontendAuthMode.OpenIdConnect: 739case FrontendAuthMode.BrowserToken: 761case FrontendAuthMode.Unsecured: 776case FrontendAuthMode.OpenIdConnect: 783case FrontendAuthMode.BrowserToken: 790case FrontendAuthMode.Unsecured: 798throw new NotSupportedException($"Unexpected {nameof(FrontendAuthMode)} enum member: {dashboardOptions.Frontend.AuthMode}"); 808FrontendAuthMode.Unsecured => FrontendAuthenticationDefaults.AuthenticationSchemeUnsecured,
Model\ValidateTokenMiddleware.cs (3)
31if (_options.CurrentValue.Frontend.AuthMode != FrontendAuthMode.BrowserToken) 33_logger.LogDebug($"Request to validate token URL but auth mode isn't set to {FrontendAuthMode.BrowserToken}."); 37else if (context.Request.Query.TryGetValue("t", out var value) && _options.CurrentValue.Frontend.AuthMode == FrontendAuthMode.BrowserToken)
Aspire.Dashboard.Tests (26)
DashboardOptionsTests.cs (3)
19AuthMode = FrontendAuthMode.Unsecured, 256options.Frontend.AuthMode = FrontendAuthMode.OpenIdConnect; 269options.Frontend.AuthMode = FrontendAuthMode.OpenIdConnect;
Integration\FrontendBrowserTokenAuthTests.cs (11)
35config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 57config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 88config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 112config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 128[InlineData(FrontendAuthMode.BrowserToken, "TestKey123!", HttpStatusCode.OK, true)] 129[InlineData(FrontendAuthMode.BrowserToken, "Wrong!", HttpStatusCode.OK, false)] 130[InlineData(FrontendAuthMode.Unsecured, "Wrong!", HttpStatusCode.BadRequest, null)] 131public async Task Post_ValidateTokenApi_AvailableBasedOnOptions(FrontendAuthMode authMode, string requestToken, HttpStatusCode statusCode, bool? result) 164config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 225config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 252config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString();
Integration\IntegrationTestHelpers.cs (1)
65[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(FrontendAuthMode.Unsecured),
Integration\Playwright\BrowserTokenAuthenticationTests.cs (1)
21Configuration[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(FrontendAuthMode.BrowserToken);
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (1)
33[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(FrontendAuthMode.Unsecured)
Integration\StartupTests.cs (2)
437Assert.Equal(FrontendAuthMode.BrowserToken, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode); 457Assert.Equal(FrontendAuthMode.Unsecured, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode);
Middleware\ValidateTokenMiddlewareTests.cs (7)
21using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty).DefaultTimeout(); 29using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty).DefaultTimeout(); 37using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 45using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 53using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 61using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 66private static async Task<IHost> SetUpHostAsync(FrontendAuthMode authMode, string expectedToken)