Browse Source

Fix the parameter name associated with the UserFields setting

pull/2553/head
Kévin Chalet 2 months ago
parent
commit
92dc2ea25b
  1. 24
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
  2. 3
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

24
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs

@ -70,8 +70,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
// The userinfo endpoints exposed by these providers
// are based on GraphQL, which requires using POST:
ProviderTypes.Buffer or ProviderTypes.Linear or ProviderTypes.Meetup
or ProviderTypes.SubscribeStar => HttpMethod.Post,
ProviderTypes.Buffer or ProviderTypes.Linear or
ProviderTypes.Meetup or ProviderTypes.SubscribeStar => HttpMethod.Post,
// The userinfo endpoints exposed by these providers
// use custom protocols that require using POST:
@ -276,14 +276,14 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
// The userinfo endpoints exposed by these providers are based on GraphQL,
// which requires sending the request parameters as a JSON payload:
ProviderTypes.Buffer or ProviderTypes.Linear or ProviderTypes.Meetup
or ProviderTypes.SubscribeStar => JsonContent.Create(
context.Transaction.Request,
OpenIddictSerializer.Default.Request,
new MediaTypeHeaderValue(MediaTypes.Json)
{
CharSet = Charsets.Utf8
}),
ProviderTypes.Buffer or ProviderTypes.Linear or
ProviderTypes.Meetup or ProviderTypes.SubscribeStar => JsonContent.Create(
context.Transaction.Request,
OpenIddictSerializer.Default.Request,
new MediaTypeHeaderValue(MediaTypes.Json)
{
CharSet = Charsets.Utf8
}),
_ => request.Content
};
@ -391,8 +391,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
["accounts"] = context.Response["accounts"]
},
// Buffer wraps the response in the standard GraphQL "data" envelope.
// Buffer returns a nested "account" object that is itself nested in a GraphQL "data" node.
ProviderTypes.Buffer => new(context.Response["data"]?["account"]?.GetNamedParameters()
?? throw new InvalidOperationException(SR.FormatID0334("data/account"))),

3
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

@ -403,6 +403,7 @@
UserInfoEndpoint="https://api.buffer.com/"
AuthorizationResponseIssParameterSupported="true">
<CodeChallengeMethod Value="S256" />
<GrantType Value="authorization_code" />
<GrantType Value="refresh_token" />
</Configuration>
@ -411,7 +412,7 @@
<Scope Name="offline_access" Default="true" Required="false" />
</Environment>
<Setting PropertyName="UserFields" ParameterName="user_fields" Collection="true" Type="String"
<Setting PropertyName="UserFields" ParameterName="fields" Collection="true" Type="String"
Description="The list of account fields to expand from the GraphQL endpoint (by default, only basic fields are requested)">
<Item Value="email" Default="true" Required="false" />
<Item Value="id" Default="true" Required="false" />

Loading…
Cancel
Save