diff --git a/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs b/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs index 9178e32af2efd..f3bd0343a557b 100644 --- a/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs +++ b/dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs @@ -21,11 +21,10 @@ namespace OpenQA.Selenium.BiDi.Modules.Network; -[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")] -[JsonDerivedType(typeof(Basic), "password")] -public abstract record AuthCredentials +public record AuthCredentials(string Username, string Password) { - public record Basic(string Username, string Password) : AuthCredentials; + [JsonInclude] + internal string Type { get; } = "password"; } diff --git a/dotnet/test/common/BiDi/Network/NetworkTest.cs b/dotnet/test/common/BiDi/Network/NetworkTest.cs index 9a6c457e69e0e..2773d539dbb37 100644 --- a/dotnet/test/common/BiDi/Network/NetworkTest.cs +++ b/dotnet/test/common/BiDi/Network/NetworkTest.cs @@ -163,7 +163,7 @@ public async Task CanContinueWithAuthCredentials() await using var intercept = await bidi.Network.InterceptAuthAsync(async e => { //TODO Seems it would be better to have method which takes abstract options - await e.Request.Request.ContinueWithAuthAsync(new AuthCredentials.Basic("test", "test")); + await e.Request.Request.ContinueWithAuthAsync(new AuthCredentials("test", "test")); }); await context.NavigateAsync(UrlBuilder.WhereIs("basicAuth"), new() { Wait = ReadinessState.Complete });