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())}");
DashboardWebApplication.cs (11)
311if (options.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 412if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.BrowserToken) 430else if (dashboardOptions.Frontend.AuthMode == FrontendAuthMode.OpenIdConnect) 727case FrontendAuthMode.OpenIdConnect: 766case FrontendAuthMode.BrowserToken: 788case FrontendAuthMode.Unsecured: 803case FrontendAuthMode.OpenIdConnect: 810case FrontendAuthMode.BrowserToken: 817case FrontendAuthMode.Unsecured: 825throw new NotSupportedException($"Unexpected {nameof(FrontendAuthMode)} enum member: {dashboardOptions.Frontend.AuthMode}"); 835FrontendAuthMode.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)
34config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 56config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 87config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 111config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 127[InlineData(FrontendAuthMode.BrowserToken, "TestKey123!", HttpStatusCode.OK, true)] 128[InlineData(FrontendAuthMode.BrowserToken, "Wrong!", HttpStatusCode.OK, false)] 129[InlineData(FrontendAuthMode.Unsecured, "Wrong!", HttpStatusCode.BadRequest, null)] 130public async Task Post_ValidateTokenApi_AvailableBasedOnOptions(FrontendAuthMode authMode, string requestToken, HttpStatusCode statusCode, bool? result) 163config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 224config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString(); 251config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = FrontendAuthMode.BrowserToken.ToString();
Integration\IntegrationTestHelpers.cs (1)
65[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(FrontendAuthMode.Unsecured),
Integration\Playwright\BrowserTokenAuthenticationTests.cs (1)
20Configuration[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)
20using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty); 28using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty); 36using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token"); 44using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token"); 52using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token"); 60using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token"); 65private static async Task<IHost> SetUpHostAsync(FrontendAuthMode authMode, string expectedToken)