diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c1dd941..cf94d110 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - dotnet-version: ['net6.0', 'net7.0', 'net8.0'] + dotnet-version: ['net6.0', 'net7.0', 'net8.0', 'net10.0'] steps: - uses: actions/checkout@v5 @@ -24,6 +24,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 10.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/rl-secure.yml b/.github/workflows/rl-secure.yml index 1350e236..50e86158 100644 --- a/.github/workflows/rl-secure.yml +++ b/.github/workflows/rl-secure.yml @@ -45,6 +45,7 @@ jobs: 6.0.x 7.0.x 8.0.x + 10.0.x - name: Create NuGet packages shell: pwsh diff --git a/README.md b/README.md index a1b49f3c..ab577fb8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A library based on `Microsoft.AspNetCore.Authentication.OpenIdConnect` to make i ## Getting started ### Requirements -This library supports .NET 6 and .NET 7. +This library supports .NET 6.0 and above. ### Installation diff --git a/docs-source/index.md b/docs-source/index.md index 6620d21a..2ea133f9 100644 --- a/docs-source/index.md +++ b/docs-source/index.md @@ -19,7 +19,7 @@ A library based on `Microsoft.AspNetCore.Authentication.OpenIdConnect` to make i ## Getting started ### Requirements -This library supports .NET 6 and .NET 7. +This library supports .NET 6.0 and above. ### Installation diff --git a/playground/Auth0.AspNetCore.Authentication.Playground/Auth0.AspNetCore.Authentication.Playground.csproj b/playground/Auth0.AspNetCore.Authentication.Playground/Auth0.AspNetCore.Authentication.Playground.csproj index e0c22d91..e1137e5c 100644 --- a/playground/Auth0.AspNetCore.Authentication.Playground/Auth0.AspNetCore.Authentication.Playground.csproj +++ b/playground/Auth0.AspNetCore.Authentication.Playground/Auth0.AspNetCore.Authentication.Playground.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net6.0;net8.0;net10.0 diff --git a/src/Auth0.AspNetCore.Authentication/Auth0.AspNetCore.Authentication.csproj b/src/Auth0.AspNetCore.Authentication/Auth0.AspNetCore.Authentication.csproj index 58619554..76d0e64a 100644 --- a/src/Auth0.AspNetCore.Authentication/Auth0.AspNetCore.Authentication.csproj +++ b/src/Auth0.AspNetCore.Authentication/Auth0.AspNetCore.Authentication.csproj @@ -1,16 +1,19 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net10.0 + + + + - - + diff --git a/src/Auth0.AspNetCore.Authentication/BackchannelLogout/BackchannelLogoutHandler.cs b/src/Auth0.AspNetCore.Authentication/BackchannelLogout/BackchannelLogoutHandler.cs index 2368a97f..0cf44e12 100644 --- a/src/Auth0.AspNetCore.Authentication/BackchannelLogout/BackchannelLogoutHandler.cs +++ b/src/Auth0.AspNetCore.Authentication/BackchannelLogout/BackchannelLogoutHandler.cs @@ -124,7 +124,9 @@ public static class HttpContextExtensions public static async Task WriteErrorAsync(this HttpContext context, int statusCode, string error, string description) { context.Response.StatusCode = statusCode; - await context.Response.WriteAsJsonAsync(new { error, error_description = description }); + context.Response.ContentType = "application/json"; + var json = System.Text.Json.JsonSerializer.Serialize(new { error, error_description = description }); + await context.Response.WriteAsync(json); } public static async Task WriteStatusCodeAsync(this HttpContext context, int statusCode) diff --git a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0.AspNetCore.Authentication.IntegrationTests.csproj b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0.AspNetCore.Authentication.IntegrationTests.csproj index abef1d42..90010a26 100644 --- a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0.AspNetCore.Authentication.IntegrationTests.csproj +++ b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0.AspNetCore.Authentication.IntegrationTests.csproj @@ -1,13 +1,14 @@  - net8.0 + net10.0 + diff --git a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0MiddlewareTests.cs b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0MiddlewareTests.cs index 177906fd..54cf2567 100644 --- a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0MiddlewareTests.cs +++ b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/Auth0MiddlewareTests.cs @@ -124,7 +124,7 @@ public async Task Should_Throw_When_Using_PAR_But_No_OIDC_Config() public async Task Should_Post_To_PAR_Endpoint() { var mockHandler = new OidcMockBuilder() - .MockOpenIdConfig() + .MockOpenIdConfig("wellknownconfig_with_par.json") .MockJwks() .MockPAR("https://my-par-request-uri") .Build(); @@ -152,7 +152,7 @@ public async Task Should_Post_To_PAR_Endpoint() public async Task Should_Handle_Errors_From_PAR_Endpoint() { var mockHandler = new OidcMockBuilder() - .MockOpenIdConfig() + .MockOpenIdConfig("wellknownconfig_with_par.json") .MockJwks() .MockPAR("https://my-par-request-uri", null, 70, HttpStatusCode.BadRequest) .Build(); diff --git a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig.json b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig.json index 5a07f904..1e478b8c 100644 --- a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig.json +++ b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig.json @@ -2,7 +2,6 @@ "issuer": "https://tenant.eu.auth0.com/", "authorization_endpoint": "https://tenant.eu.auth0.com/authorize", "token_endpoint": "https://tenant.eu.auth0.com/oauth/token", - "pushed_authorization_request_endpoint": "https://tenant.eu.auth0.com/oauth/par", "device_authorization_endpoint": "https://tenant.eu.auth0.com/oauth/device/code", "userinfo_endpoint": "https://tenant.eu.auth0.com/userinfo", "mfa_challenge_endpoint": "https://tenant.eu.auth0.com/mfa/challenge", diff --git a/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig_with_par.json b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig_with_par.json new file mode 100644 index 00000000..7e7a71d7 --- /dev/null +++ b/tests/Auth0.AspNetCore.Authentication.IntegrationTests/wellknownconfig_with_par.json @@ -0,0 +1,64 @@ +{ + "issuer": "https://tenant.eu.auth0.com/", + "authorization_endpoint": "https://tenant.eu.auth0.com/authorize", + "token_endpoint": "https://tenant.eu.auth0.com/oauth/token", + "pushed_authorization_request_endpoint": "https://tenant.eu.auth0.com/oauth/par", + "device_authorization_endpoint": "https://tenant.eu.auth0.com/oauth/device/code", + "userinfo_endpoint": "https://tenant.eu.auth0.com/userinfo", + "mfa_challenge_endpoint": "https://tenant.eu.auth0.com/mfa/challenge", + "jwks_uri": "https://tenant.eu.auth0.com/.well-known/jwks.json", + "registration_endpoint": "https://tenant.eu.auth0.com/oidc/register", + "revocation_endpoint": "https://tenant.eu.auth0.com/oauth/revoke", + "scopes_supported": [ + "openid", + "profile", + "offline_access", + "name", + "given_name", + "family_name", + "nickname", + "email", + "email_verified", + "picture", + "created_at", + "identities", + "phone", + "address" + ], + "response_types_supported": [ + "code", + "token", + "id_token", + "code token", + "code id_token", + "token id_token", + "code token id_token" + ], + "code_challenge_methods_supported": [ "S256", "plain" ], + "response_modes_supported": [ "query", "fragment", "form_post" ], + "subject_types_supported": [ "public" ], + "id_token_signing_alg_values_supported": [ "HS256", "RS256" ], + "token_endpoint_auth_methods_supported": [ + "client_secret_basic", + "client_secret_post" + ], + "claims_supported": [ + "aud", + "auth_time", + "created_at", + "email", + "email_verified", + "exp", + "family_name", + "given_name", + "iat", + "identities", + "iss", + "name", + "nickname", + "phone_number", + "picture", + "sub" + ], + "request_uri_parameter_supported": false +}