From 914a7e6712fec9c96c15e66dc8c90e774c7afff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 4 Jul 2024 07:33:33 +0200 Subject: [PATCH] Add Typeform to the list of supported providers --- .../OpenIddictClientWebIntegrationHandlers.cs | 6 ++++- ...penIddictClientWebIntegrationProviders.xml | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs index b8baa579..5c85d8fe 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs @@ -1276,13 +1276,17 @@ public static partial class OpenIddictClientWebIntegrationHandlers // Trovo returns the username as a custom "userName" node: ProviderTypes.Trovo => (string?) context.UserinfoResponse?["userName"], + // Typeform returns the username as a custom "alias" node: + ProviderTypes.Typeform => (string?) context.UserinfoResponse?["alias"], + _ => context.MergedPrincipal.GetClaim(ClaimTypes.Name) }); context.MergedPrincipal.SetClaim(ClaimTypes.NameIdentifier, issuer: issuer, value: context.Registration.ProviderType switch { // These providers return the user identifier as a custom "user_id" node: - ProviderTypes.Amazon or ProviderTypes.HubSpot or ProviderTypes.StackExchange + ProviderTypes.Amazon or ProviderTypes.HubSpot or + ProviderTypes.StackExchange or ProviderTypes.Typeform => (string?) context.UserinfoResponse?["user_id"], // ArcGIS and Trakt don't return a user identifier and require using the username as the identifier: diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml index ca0d1a57..fd7cb4cd 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml @@ -1964,6 +1964,32 @@ + + + + + + + + + + + + + + +