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

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

@ -403,6 +403,7 @@
UserInfoEndpoint="https://api.buffer.com/" UserInfoEndpoint="https://api.buffer.com/"
AuthorizationResponseIssParameterSupported="true"> AuthorizationResponseIssParameterSupported="true">
<CodeChallengeMethod Value="S256" /> <CodeChallengeMethod Value="S256" />
<GrantType Value="authorization_code" /> <GrantType Value="authorization_code" />
<GrantType Value="refresh_token" /> <GrantType Value="refresh_token" />
</Configuration> </Configuration>
@ -411,7 +412,7 @@
<Scope Name="offline_access" Default="true" Required="false" /> <Scope Name="offline_access" Default="true" Required="false" />
</Environment> </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)"> 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="email" Default="true" Required="false" />
<Item Value="id" Default="true" Required="false" /> <Item Value="id" Default="true" Required="false" />

Loading…
Cancel
Save