Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/AdminConsole/AdminConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.3.0" />
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.1" />
<PackageReference Include="Azure.Identity" Version="1.15.0" />
<PackageReference Include="Datadog.Trace" Version="3.2.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.3.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.1">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="4.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="4.3.0" />
<PackageReference Include="Passwordless.AspNetCore" Version="2.1.0-beta.4" />
<PackageReference Include="Stripe.net" Version="41.*" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<PackageReference Include="AspNetCore.HealthChecks.Sqlite" Version="9.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="9.0.0" />
<PackageReference Include="Datadog.Trace" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="MinimalApis.Extensions" Version="0.11.0" />
<PackageReference Include="UAParser" Version="3.1.47" />
</ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions src/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Fido2" Version="4.0.0-beta.16" />
<PackageReference Include="Fido2.Models" Version="4.0.0-beta.16" />
<PackageReference Include="Fido2" Version="4.0.0" />
<PackageReference Include="Fido2.Models" Version="4.0.0" />
<PackageReference Include="HtmlSanitizer" Version="9.0.886" />
<PackageReference Include="MailKit" Version="4.9.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.1" />
<PackageReference Include="MailKit" Version="4.13.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.9" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Datadog.Logs" Version="0.5.4" />
<PackageReference Include="Serilog.Sinks.Datadog.Logs" Version="0.5.6" />
<PackageReference Include="Serilog.Sinks.Seq" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.9" />
<PackageReference Include="AWSSDK.SimpleEmailV2" Version="4.0.5.1" />
<PackageReference Include="SendGrid" Version="9.29.3" />
</ItemGroup>
Expand Down
9 changes: 4 additions & 5 deletions src/Service/Fido2Service.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Buffers.Text;
using System.Collections.Immutable;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Text;
Expand Down Expand Up @@ -146,9 +145,9 @@ public async Task<SessionResponse<CredentialCreateOptions>> RegisterBeginAsync(F
var requestNewCredentialParameters = new RequestNewCredentialParams
{
User = user,
ExcludeCredentials = keyIds,
AttestationPreference = attestation,
AuthenticatorSelection = authenticatorSelection,
ExcludeCredentials = keyIds,
Extensions = new AuthenticationExtensionsClientInputs
{
CredProps = true
Expand Down Expand Up @@ -383,10 +382,10 @@ public async Task<TokenResponse> SignInCompleteAsync(SignInCompleteDTO request,
var authenticationSessionConfiguration = await _tokenService.DecodeTokenAsync<AuthenticationSessionConfiguration>(request.Session, "session_", true);

// Get registered credential from database
var credential = await _storage.GetCredential(request.Response.Id);
var credential = await _storage.GetCredential(request.Response.RawId);
if (credential == null)
{
throw new UnknownCredentialException(Base64Url.EncodeToString(request.Response.Id));
throw new UnknownCredentialException(request.Response.Id);
}

// Create callback to check if userhandle owns the credentialId
Expand Down
26 changes: 13 additions & 13 deletions src/Service/Service.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Fido2" Version="4.0.0-beta.16" />
<PackageReference Include="Fido2.AspNet" Version="4.0.0-beta.16" />
<PackageReference Include="Fido2.Models" Version="4.0.0-beta.16" />
<PackageReference Include="Fido2" Version="4.0.0" />
<PackageReference Include="Fido2.AspNet" Version="4.0.0" />
<PackageReference Include="Fido2.Models" Version="4.0.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="MessagePack" Version="3.1.1" />
<PackageReference Include="MessagePackAnalyzer" Version="3.1.1">
<PackageReference Include="MessagePack" Version="3.1.4" />
<PackageReference Include="MessagePackAnalyzer" Version="3.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="9.0.9" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions tests/AdminConsole.Tests/AdminConsole.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="bunit" Version="1.38.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="bunit" Version="1.40.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
16 changes: 8 additions & 8 deletions tests/Api.IntegrationTests/Api.IntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.1"/>
<PackageReference Include="Bogus" Version="35.6.3"/>
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1"/>
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageReference Include="Selenium.WebDriver" Version="4.28.0"/>
<PackageReference Include="Testcontainers.MsSql" Version="4.1.0"/>
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9"/>
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1"/>
<PackageReference Include="Selenium.WebDriver" Version="4.35.0"/>
<PackageReference Include="Testcontainers.MsSql" Version="4.7.0"/>
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
18 changes: 9 additions & 9 deletions tests/Api.IntegrationTests/Helpers/BrowserCredentialsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class BrowserCredentialsHelper
private static Task<string> ReadCreateCredentialFileAsync() => File.ReadAllTextAsync(CreateCredentialsFile);
private static Task<string> ReadGetCredentialFileAsync() => File.ReadAllTextAsync(GetCredentialFile);

private async static Task<string> GetCreateCredentialFunctions()
private static async Task<string> GetCreateCredentialFunctions()
{
var tasks = new[] { ReadConvertersFileAsync(), ReadCreateCredentialFileAsync() };
await Task.WhenAll(tasks);
Expand All @@ -23,28 +23,28 @@ private async static Task<string> GetCreateCredentialFunctions()
return result;
}

public async static Task<AuthenticatorAttestationRawResponse> CreateCredentialsAsync(CredentialCreateOptions options, string originUrl)
public static async Task<AuthenticatorAttestationRawResponse> CreateCredentialsAsync(CredentialCreateOptions options, string originUrl)
{
using var driver = WebDriverFactory.GetDriver(originUrl);

return await driver.CreateCredentialsAsync(options);
}

public async static Task<AuthenticatorAttestationRawResponse> CreateCredentialsAsync(this IJavaScriptExecutor webDriver, CredentialCreateOptions options) =>
public static async Task<AuthenticatorAttestationRawResponse> CreateCredentialsAsync(this IJavaScriptExecutor webDriver, CredentialCreateOptions options) =>
JsonSerializer.Deserialize<AuthenticatorAttestationRawResponse>(
(webDriver.ExecuteScript($"{await GetCreateCredentialFunctions()} return await createCredential({options.ToJson()});").ToString()
?? string.Empty))!;
webDriver.ExecuteScript($"{await GetCreateCredentialFunctions()} return await createCredential({options.ToJson()});").ToString()
?? string.Empty)!;

private async static Task<string> GetGetCredentialFunctions()
private static async Task<string> GetGetCredentialFunctions()
{
var tasks = new[] { ReadConvertersFileAsync(), ReadGetCredentialFileAsync() };
await Task.WhenAll(tasks);

return tasks.Aggregate(string.Empty, (functions, task) => string.Concat(functions, task.Result));
}

public async static Task<AuthenticatorAssertionRawResponse> GetCredentialsAsync(this IJavaScriptExecutor webDriver, AssertionOptions options) =>
public static async Task<AuthenticatorAssertionRawResponse> GetCredentialsAsync(this IJavaScriptExecutor webDriver, AssertionOptions options) =>
JsonSerializer.Deserialize<AuthenticatorAssertionRawResponse>(
(webDriver.ExecuteScript($"{await GetGetCredentialFunctions()} return await getCredential({options.ToJson()});").ToString()
?? string.Empty))!;
webDriver.ExecuteScript($"{await GetGetCredentialFunctions()} return await getCredential({options.ToJson()});")?.ToString()
?? string.Empty)!;
}
49 changes: 25 additions & 24 deletions tests/Api.IntegrationTests/Helpers/Js/createCredential.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
async function createCredential(credentialCreateOptions) {
credentialCreateOptions.challenge = base64UrlToArrayBuffer(credentialCreateOptions.challenge);
credentialCreateOptions.user.id = base64UrlToArrayBuffer(credentialCreateOptions.user.id);
credentialCreateOptions.excludeCredentials?.forEach((cred) => {
cred.id = base64UrlToArrayBuffer(cred.id);
});

const credential = await navigator.credentials.create({
publicKey: credentialCreateOptions,
});

const attestationResponse = credential.response;

return JSON.stringify({
id: credential.id,
rawId: arrayBufferToBase64Url(credential.rawId),
type: credential.type,
extensions: credential.getClientExtensionResults(),
response: {
attestationObject: arrayBufferToBase64Url(attestationResponse.attestationObject),
clientDataJSON: arrayBufferToBase64Url(attestationResponse.clientDataJSON),
}
});
}
async function createCredential(credentialCreateOptions) {
credentialCreateOptions.challenge = base64UrlToArrayBuffer(credentialCreateOptions.challenge);
credentialCreateOptions.user.id = base64UrlToArrayBuffer(credentialCreateOptions.user.id);
credentialCreateOptions.excludeCredentials?.forEach((cred) => {
cred.id = base64UrlToArrayBuffer(cred.id);
});

const credential = await navigator.credentials.create({
publicKey: credentialCreateOptions,
});

const attestationResponse = credential.response;

return JSON.stringify({
id: credential.id,
rawId: arrayBufferToBase64Url(credential.rawId),
type: credential.type,
extensions: credential.getClientExtensionResults(),
response: {
attestationObject: arrayBufferToBase64Url(attestationResponse.attestationObject),
clientDataJSON: arrayBufferToBase64Url(attestationResponse.clientDataJSON),
transports: attestationResponse.getTransports ? attestationResponse.getTransports() : [],
}
});
}
4 changes: 2 additions & 2 deletions tests/Api.Tests/Api.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions tests/Common.Tests/Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions tests/Service.Tests/Service.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<ItemGroup>
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Loading