From 2737e245c4f80b8fddba83dd8e6e32ffe5f1ed5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 3 Mar 2024 16:39:59 +0100 Subject: [PATCH] Add Mastodon to the list of supported providers --- .../OpenIddictClientWebIntegrationHandlers.cs | 17 ++-- ...penIddictClientWebIntegrationProviders.xml | 99 ++++++++++++------- 2 files changed, 73 insertions(+), 43 deletions(-) diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs index ce984b2a..578a6e04 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs @@ -1118,7 +1118,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers // These providers return the username as a custom "username" node: ProviderTypes.ArcGisOnline or ProviderTypes.Dailymotion or ProviderTypes.DeviantArt or ProviderTypes.Discord or ProviderTypes.Disqus or ProviderTypes.Lichess or - ProviderTypes.Mixcloud or ProviderTypes.Trakt or ProviderTypes.WordPress + ProviderTypes.Mastodon or ProviderTypes.Mixcloud or ProviderTypes.Trakt or + ProviderTypes.WordPress => (string?) context.UserinfoResponse?["username"], // Basecamp and Harvest don't return a username so one is created using the "first_name" and "last_name" nodes: @@ -1195,13 +1196,13 @@ public static partial class OpenIddictClientWebIntegrationHandlers => (string?) context.UserinfoResponse?["username"], // These providers return the user identifier as a custom "id" node: - ProviderTypes.Basecamp or ProviderTypes.Dailymotion or ProviderTypes.Deezer or - ProviderTypes.Discord or ProviderTypes.Disqus or ProviderTypes.Facebook or - ProviderTypes.GitHub or ProviderTypes.Harvest or ProviderTypes.Kroger or - ProviderTypes.Lichess or ProviderTypes.Meetup or ProviderTypes.Nextcloud or - ProviderTypes.Patreon or ProviderTypes.Reddit or ProviderTypes.Smartsheet or - ProviderTypes.Spotify or ProviderTypes.SubscribeStar or ProviderTypes.Twitter or - ProviderTypes.Zoom + ProviderTypes.Basecamp or ProviderTypes.Dailymotion or ProviderTypes.Deezer or + ProviderTypes.Discord or ProviderTypes.Disqus or ProviderTypes.Facebook or + ProviderTypes.GitHub or ProviderTypes.Harvest 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.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 c0507e5d..1ce283c1 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml @@ -6,11 +6,11 @@ --> @@ -779,6 +779,35 @@ + + + + + + + + + + + + + + + +