Browse Source

Add client_credentials to the list of grant types supported by Reddit

pull/1636/head
Kévin Chalet 3 years ago
parent
commit
46e2e4cf9a
  1. 2
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
  2. 1
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
  3. 1
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

2
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs

@ -545,6 +545,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
context.Request["access_type"] = options.AccessType;
}
// By default, Reddit doesn't return a refresh token but
// allows sending a "duration" parameter to retrieve one.
else if (context.Registration.ProviderName is Providers.Reddit)
{
var options = context.Registration.GetRedditOptions();

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

@ -136,6 +136,7 @@
TokenEndpoint="https://www.reddit.com/api/v1/access_token"
UserinfoEndpoint="https://oauth.reddit.com/api/v1/me">
<GrantType Value="authorization_code" />
<GrantType Value="client_credentials" />
<GrantType Value="refresh_token" />
<TokenEndpointAuthMethod Value="client_secret_basic" />

1
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

@ -64,6 +64,7 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="authorization_code" />
<xs:enumeration value="client_credentials" />
<xs:enumeration value="implicit" />
<xs:enumeration value="refresh_token" />
</xs:restriction>

Loading…
Cancel
Save