51 references to FrontendAuthMode
Aspire.Dashboard (25)
Authentication\FrontendCompositeAuthenticationHandler.cs (2)
48
FrontendAuthMode
.OpenIdConnect => FrontendAuthenticationDefaults.AuthenticationSchemeOpenIdConnect,
49
FrontendAuthMode
.BrowserToken => FrontendAuthenticationDefaults.AuthenticationSchemeBrowserToken,
Components\Controls\UserProfile.razor.cs (1)
42
if (DashboardOptions.CurrentValue.Frontend.AuthMode ==
FrontendAuthMode
.OpenIdConnect)
Configuration\DashboardOptions.cs (1)
156
public
FrontendAuthMode
? AuthMode { get; set; }
Configuration\PostConfigureDashboardOptions.cs (3)
49
options.Frontend.AuthMode =
FrontendAuthMode
.Unsecured;
54
options.Frontend.AuthMode ??=
FrontendAuthMode
.BrowserToken;
57
if (options.Frontend.AuthMode ==
FrontendAuthMode
.BrowserToken && string.IsNullOrEmpty(options.Frontend.BrowserToken))
Configuration\ValidateDashboardOptions.cs (4)
36
case
FrontendAuthMode
.Unsecured:
38
case
FrontendAuthMode
.OpenIdConnect:
44
case
FrontendAuthMode
.BrowserToken:
51
errorMessages.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)
311
if (options.Frontend.AuthMode ==
FrontendAuthMode
.BrowserToken)
412
if (dashboardOptions.Frontend.AuthMode ==
FrontendAuthMode
.BrowserToken)
430
else if (dashboardOptions.Frontend.AuthMode ==
FrontendAuthMode
.OpenIdConnect)
727
case
FrontendAuthMode
.OpenIdConnect:
766
case
FrontendAuthMode
.BrowserToken:
788
case
FrontendAuthMode
.Unsecured:
803
case
FrontendAuthMode
.OpenIdConnect:
810
case
FrontendAuthMode
.BrowserToken:
817
case
FrontendAuthMode
.Unsecured:
825
throw new NotSupportedException($"Unexpected {nameof(
FrontendAuthMode
)} enum member: {dashboardOptions.Frontend.AuthMode}");
835
FrontendAuthMode
.Unsecured => FrontendAuthenticationDefaults.AuthenticationSchemeUnsecured,
Model\ValidateTokenMiddleware.cs (3)
31
if (_options.CurrentValue.Frontend.AuthMode !=
FrontendAuthMode
.BrowserToken)
33
_logger.LogDebug($"Request to validate token URL but auth mode isn't set to {
FrontendAuthMode
.BrowserToken}.");
37
else if (context.Request.Query.TryGetValue("t", out var value) && _options.CurrentValue.Frontend.AuthMode ==
FrontendAuthMode
.BrowserToken)
Aspire.Dashboard.Tests (26)
DashboardOptionsTests.cs (3)
19
AuthMode =
FrontendAuthMode
.Unsecured,
256
options.Frontend.AuthMode =
FrontendAuthMode
.OpenIdConnect;
269
options.Frontend.AuthMode =
FrontendAuthMode
.OpenIdConnect;
Integration\FrontendBrowserTokenAuthTests.cs (11)
34
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
56
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
87
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
111
config[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)]
130
public async Task Post_ValidateTokenApi_AvailableBasedOnOptions(
FrontendAuthMode
authMode, string requestToken, HttpStatusCode statusCode, bool? result)
163
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
224
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
251
config[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] =
FrontendAuthMode
.BrowserToken.ToString();
Integration\IntegrationTestHelpers.cs (1)
65
[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(
FrontendAuthMode
.Unsecured),
Integration\Playwright\BrowserTokenAuthenticationTests.cs (1)
20
Configuration[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(
FrontendAuthMode
.BrowserToken);
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (1)
33
[DashboardConfigNames.DashboardFrontendAuthModeName.ConfigKey] = nameof(
FrontendAuthMode
.Unsecured)
Integration\StartupTests.cs (2)
437
Assert.Equal(
FrontendAuthMode
.BrowserToken, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode);
457
Assert.Equal(
FrontendAuthMode
.Unsecured, app.DashboardOptionsMonitor.CurrentValue.Frontend.AuthMode);
Middleware\ValidateTokenMiddlewareTests.cs (7)
20
using var host = await SetUpHostAsync(
FrontendAuthMode
.Unsecured, string.Empty);
28
using var host = await SetUpHostAsync(
FrontendAuthMode
.Unsecured, string.Empty);
36
using var host = await SetUpHostAsync(
FrontendAuthMode
.BrowserToken, "token");
44
using var host = await SetUpHostAsync(
FrontendAuthMode
.BrowserToken, "token");
52
using var host = await SetUpHostAsync(
FrontendAuthMode
.BrowserToken, "token");
60
using var host = await SetUpHostAsync(
FrontendAuthMode
.BrowserToken, "token");
65
private static async Task<IHost> SetUpHostAsync(
FrontendAuthMode
authMode, string expectedToken)