From a4177313c948d992e80cfe29caeceb2c1f71d0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 4 Jul 2024 06:06:51 +0200 Subject: [PATCH] Add Pipedrive to the list of supported providers --- ...ictClientSystemIntegrationConfiguration.cs | 2 -- ...penIddictClientSystemIntegrationOptions.cs | 2 +- ...tClientWebIntegrationHandlers.Discovery.cs | 4 ++-- ...ctClientWebIntegrationHandlers.Userinfo.cs | 3 ++- .../OpenIddictClientWebIntegrationHandlers.cs | 23 ++++++++----------- ...penIddictClientWebIntegrationProviders.xml | 22 ++++++++++++++++++ 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs index dfa22e74..0b435020 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationConfiguration.cs @@ -7,9 +7,7 @@ using System.ComponentModel; using System.IO.Pipes; using System.Net; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Runtime.Versioning; using System.Security.AccessControl; using System.Security.Principal; using System.Text; diff --git a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationOptions.cs b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationOptions.cs index 1e7d20c6..70a8ab84 100644 --- a/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationOptions.cs +++ b/src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationOptions.cs @@ -15,7 +15,7 @@ namespace OpenIddict.Client.SystemIntegration; public sealed class OpenIddictClientSystemIntegrationOptions { /// - /// Gets or sets the authentication mode used to start interactive authentication and logout flows.. + /// Gets or sets the authentication mode used to start interactive authentication and logout flows. /// /// /// If this property is not explicitly set, its value is automatically set by OpenIddict. diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs index d99ffc24..8efe5f8f 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs @@ -62,8 +62,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers // For more information about the special tenants supported by Microsoft Account/Entra ID, see // https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc#find-your-apps-openid-configuration-document-uri. ProviderTypes.Microsoft when context.Registration.GetMicrosoftSettings() is { Tenant: string tenant } => - string.Equals(tenant, "common", StringComparison.OrdinalIgnoreCase) ? "https://login.microsoftonline.com/common/v2.0" : - string.Equals(tenant, "consumers", StringComparison.OrdinalIgnoreCase) ? "https://login.microsoftonline.com/consumers/v2.0" : + string.Equals(tenant, "common", StringComparison.OrdinalIgnoreCase) ? "https://login.microsoftonline.com/common/v2.0" : + string.Equals(tenant, "consumers", StringComparison.OrdinalIgnoreCase) ? "https://login.microsoftonline.com/consumers/v2.0" : string.Equals(tenant, "organizations", StringComparison.OrdinalIgnoreCase) ? "https://login.microsoftonline.com/organizations/v2.0" : context.Response[Metadata.Issuer], diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs index 9db80547..1b984cee 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs @@ -413,7 +413,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers }, // These providers return a nested "data" object. - ProviderTypes.Kook or ProviderTypes.Kroger or ProviderTypes.Patreon or ProviderTypes.Twitter + ProviderTypes.Kook or ProviderTypes.Kroger or + ProviderTypes.Patreon or ProviderTypes.Pipedrive or ProviderTypes.Twitter => new(context.Response["data"]?.GetNamedParameters() ?? throw new InvalidOperationException(SR.FormatID0334("data"))), diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs index e06b5223..3af72cd0 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs @@ -307,7 +307,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers } } - else if (context.Registration.ProviderType is ProviderTypes.Mixcloud) + else if (context.Registration.ProviderType is ProviderTypes.Mixcloud or ProviderTypes.Pipedrive) { var error = (string?) context.Request[Parameters.Error]; if (string.Equals(error, "user_denied", StringComparison.Ordinal)) @@ -1276,9 +1276,6 @@ public static partial class OpenIddictClientWebIntegrationHandlers // Trovo returns the username as a custom "userName" node: ProviderTypes.Trovo => (string?) context.UserinfoResponse?["userName"], - // Tumblr returns the username as a custom "name" node: - ProviderTypes.Tumblr => (string?) context.UserinfoResponse?["name"], - _ => context.MergedPrincipal.GetClaim(ClaimTypes.Name) }); @@ -1296,15 +1293,15 @@ public static partial class OpenIddictClientWebIntegrationHandlers ProviderTypes.Atlassian => (string?) context.UserinfoResponse?["account_id"], // These providers return the user identifier as a custom "id" node: - ProviderTypes.Basecamp or ProviderTypes.Box or ProviderTypes.Dailymotion or - ProviderTypes.Deezer or ProviderTypes.Discord or ProviderTypes.Disqus or - ProviderTypes.Facebook or ProviderTypes.Gitee or ProviderTypes.GitHub or - ProviderTypes.Harvest or ProviderTypes.Kook or ProviderTypes.Kroger or - ProviderTypes.Lichess or ProviderTypes.Mastodon or ProviderTypes.Meetup or - ProviderTypes.Nextcloud or ProviderTypes.Patreon or ProviderTypes.Reddit or - ProviderTypes.Smartsheet or ProviderTypes.Spotify or ProviderTypes.SubscribeStar or - ProviderTypes.Todoist or ProviderTypes.Twitter or ProviderTypes.Weibo or - ProviderTypes.Zoom + ProviderTypes.Basecamp or ProviderTypes.Box or ProviderTypes.Dailymotion or + ProviderTypes.Deezer or ProviderTypes.Discord or ProviderTypes.Disqus or + ProviderTypes.Facebook or ProviderTypes.Gitee or ProviderTypes.GitHub or + ProviderTypes.Harvest or ProviderTypes.Kook or ProviderTypes.Kroger or + ProviderTypes.Lichess or ProviderTypes.Mastodon or ProviderTypes.Meetup or + ProviderTypes.Nextcloud or ProviderTypes.Patreon or ProviderTypes.Pipedrive or + ProviderTypes.Reddit or ProviderTypes.Smartsheet or ProviderTypes.Spotify or + ProviderTypes.SubscribeStar or ProviderTypes.Todoist or ProviderTypes.Twitter or + ProviderTypes.Weibo 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 7beaf2d6..b3cb7c46 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml @@ -1304,6 +1304,28 @@ Description="The URI used to access the PingOne instance (e.g 'https://auth.pingone.eu/3bedc164-22f1-4f8f-9f51-227975033cbd/as')" /> + + + + + + + + + + + + +