diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs index 51dd4646..29e741ae 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs @@ -292,6 +292,10 @@ public static partial class OpenIddictClientWebIntegrationHandlers ["accounts"] = context.Response["accounts"] }, + // Kroger and Twitter return a nested "data" object. + ProviderTypes.Kroger or ProviderTypes.Twitter => new(context.Response["data"]?.GetNamedParameters() ?? + throw new InvalidOperationException(SR.FormatID0334("data"))), + // Patreon returns a nested "attributes" object that is itself nested in a "data" node. ProviderTypes.Patreon => new(context.Response["data"]?["attributes"]?.GetNamedParameters() ?? throw new InvalidOperationException(SR.FormatID0334("data/attributes"))), @@ -313,10 +317,6 @@ public static partial class OpenIddictClientWebIntegrationHandlers let name = $"{parameter.Key}_{node.Key}" select new KeyValuePair(name, node.Value)), - // Twitter returns a nested "data" object. - ProviderTypes.Twitter => new(context.Response["data"]?.GetNamedParameters() ?? - throw new InvalidOperationException(SR.FormatID0334("data"))), - _ => context.Response }; diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml index 3dc93398..ab52bba1 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml @@ -484,6 +484,53 @@ Description="The URI used to access the Keycloak identity provider (including the realm, if applicable)" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +