From 517b1b632492bcd5e04c9d9fc17be1bc9f7b39e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Mon, 6 Nov 2023 05:37:43 +0100 Subject: [PATCH] Add Zoom to the list of supported providers --- Directory.Build.targets | 2 +- ...OpenIddictClientWebIntegrationGenerator.cs | 2 +- .../OpenIddictHelpers.cs | 2 +- ...ClientDataProtectionHandlers.Protection.cs | 2 +- ...tClientWebIntegrationHandlers.Discovery.cs | 7 +++--- .../OpenIddictClientWebIntegrationHandlers.cs | 7 +++--- ...penIddictClientWebIntegrationProviders.xml | 25 +++++++++++++++++++ ...ctEntityFrameworkCoreAuthorizationStore.cs | 10 ++++---- ...OpenIddictEntityFrameworkCoreTokenStore.cs | 4 +-- ...ServerDataProtectionHandlers.Protection.cs | 2 +- .../OpenIddictServerHandlers.Protection.cs | 2 +- .../OpenIddictServerIntegrationTests.cs | 2 +- 12 files changed, 46 insertions(+), 21 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 3fa30360..692ac5ab 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -123,7 +123,7 @@ diff --git a/gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs b/gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs index a5e4f1b3..b561a075 100644 --- a/gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs +++ b/gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs @@ -1072,7 +1072,7 @@ public sealed partial class OpenIddictClientWebIntegrationConfiguration _ => [] }, - DeviceAuthorizationEndpointAuthMethodsSupported = configuration.Elements("DeviceAuthorizationEndpointAuthMethodsSupported").ToList() switch + DeviceAuthorizationEndpointAuthMethodsSupported = configuration.Elements("DeviceAuthorizationEndpointAuthMethod").ToList() switch { { Count: > 0 } methods => methods.Select(type => (string?) type.Attribute("Value")).ToList(), diff --git a/shared/OpenIddict.Extensions/OpenIddictHelpers.cs b/shared/OpenIddict.Extensions/OpenIddictHelpers.cs index 26118989..36d0f7e1 100644 --- a/shared/OpenIddict.Extensions/OpenIddictHelpers.cs +++ b/shared/OpenIddict.Extensions/OpenIddictHelpers.cs @@ -476,7 +476,7 @@ internal static class OpenIddictHelpers // Note: on .NET Framework, the RSA.Create() overload uses CryptoConfig.CreateFromName() // and always returns a RSACryptoServiceProvider instance unless the default name mapping was - // explicitly overriden in machine.config or via CryptoConfig.AddAlgorithm(). Unfortunately, + // explicitly overridden in machine.config or via CryptoConfig.AddAlgorithm(). Unfortunately, // RSACryptoServiceProvider still uses 1024-bit keys by default and doesn't support changing // the key size via RSACryptoServiceProvider.KeySize (setting it has no effect on the object). // diff --git a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs index 69f0433b..9768ce20 100644 --- a/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs +++ b/src/OpenIddict.Client.DataProtection/OpenIddictClientDataProtectionHandlers.Protection.cs @@ -185,7 +185,7 @@ public static partial class OpenIddictClientDataProtectionHandlers // of the default token format (typically, JSON Web Token). By default, Data Protection // is automatically used for all the supported token types once the integration is enabled // but the default token format can be re-enabled in the options. Alternatively, the token - // format can be overriden manually using a custom event handler registered after this one. + // format can be overridden manually using a custom event handler registered after this one. context.TokenFormat = context.TokenType switch { diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs index 4d40320e..6b4a2508 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs @@ -251,7 +251,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers } // Google doesn't properly implement the device authorization grant, doesn't support - // client authentication method for the device authorization endpoint and returns a + // basic client authentication for the device authorization endpoint and returns a // generic "invalid_request" request when using "client_secret_basic" instead of // sending the client identifier in the request form. To work around this limitation, // "client_secret_post" is listed as the only supported client authentication method. @@ -352,10 +352,9 @@ public static partial class OpenIddictClientWebIntegrationHandlers // While PayPal supports OpenID Connect discovery, the configuration document returned // by the sandbox environment always contains the production endpoints, which would // prevent the OpenIddict integration from working properly when using the sandbox mode. - // To work around that, the endpoints are manually overriden when this environment is used. + // To work around that, the endpoints are manually overridden when this environment is used. else if (context.Registration.ProviderType is ProviderTypes.PayPal && - context.Registration.GetPayPalSettings() is { Environment: string environment } && - string.Equals(environment, PayPal.Environments.Sandbox, StringComparison.OrdinalIgnoreCase)) + context.Registration.GetPayPalSettings() is { Environment: PayPal.Environments.Sandbox }) { context.Configuration.AuthorizationEndpoint = new Uri("https://www.sandbox.paypal.com/signin/authorize", UriKind.Absolute); diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs index 60c9080c..b9702568 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs @@ -1067,8 +1067,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers context.UserinfoResponse?.HasParameter("lastName") is true => $"{(string?) context.UserinfoResponse?["firstName"]} {(string?) context.UserinfoResponse?["lastName"]}", - // Spotify and StackExchange return the username as a custom "display_name" node: - ProviderTypes.Spotify or ProviderTypes.StackExchange + // These providers return return the username as a custom "display_name" node: + ProviderTypes.Spotify or ProviderTypes.StackExchange or ProviderTypes.Zoom => (string?) context.UserinfoResponse?["display_name"], // Strava returns the username as a custom "athlete/username" node in token responses: @@ -1097,7 +1097,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers ProviderTypes.Facebook or ProviderTypes.GitHub or ProviderTypes.Harvest or ProviderTypes.Kroger or ProviderTypes.Lichess or ProviderTypes.Nextcloud or ProviderTypes.Patreon or ProviderTypes.Reddit or ProviderTypes.Smartsheet or - ProviderTypes.Spotify or ProviderTypes.SubscribeStar or ProviderTypes.Twitter + ProviderTypes.Spotify or ProviderTypes.SubscribeStar or ProviderTypes.Twitter or + ProviderTypes.Zoom => (string?) context.UserinfoResponse?["id"], // Bitbucket returns the user identifier as a custom "uuid" node: diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml index e60f37be..cb458ba3 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml @@ -1421,4 +1421,29 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs index 9633fab2..31e21d66 100644 --- a/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs +++ b/src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreAuthorizationStore.cs @@ -234,7 +234,7 @@ public class OpenIddictEntityFrameworkCoreAuthorizationStore(); + return []; }).GetAwaiter().GetResult(); } diff --git a/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs b/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs index 83869a0b..dcc2bc3d 100644 --- a/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs +++ b/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs @@ -2100,7 +2100,7 @@ public abstract partial class OpenIddictServerIntegrationTests } [Fact] - public async Task ProcessSignIn_ScopesCanBeOverridenForRefreshTokenRequests() + public async Task ProcessSignIn_ScopesCanBeOverriddenForRefreshTokenRequests() { // Arrange await using var server = await CreateServerAsync(options =>