Browse Source

Add KOOK to the list of supported providers

pull/2092/head
Ge 2 years ago
committed by GitHub
parent
commit
7cf4c28e40
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
  2. 22
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
  3. 25
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

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

@ -411,8 +411,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
["accounts"] = context.Response["accounts"]
},
// Kroger, Twitter and Patreon return a nested "data" object.
ProviderTypes.Kroger or ProviderTypes.Patreon or ProviderTypes.Twitter
// These providers return a nested "data" object.
ProviderTypes.Kook or ProviderTypes.Kroger or ProviderTypes.Patreon or ProviderTypes.Twitter
=> new(context.Response["data"]?.GetNamedParameters() ??
throw new InvalidOperationException(SR.FormatID0334("data"))),

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

@ -1175,9 +1175,9 @@ 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.Mastodon or ProviderTypes.Mixcloud or ProviderTypes.Trakt or
ProviderTypes.WordPress
ProviderTypes.Discord or ProviderTypes.Disqus or ProviderTypes.Kook or
ProviderTypes.Lichess or 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:
@ -1260,14 +1260,14 @@ public static partial class OpenIddictClientWebIntegrationHandlers
ProviderTypes.Atlassian => (string?) context.UserinfoResponse?["account_id"],
// These providers return the user identifier as a custom "id" node:
ProviderTypes.Basecamp or ProviderTypes.Box 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.Todoist or ProviderTypes.Twitter or
ProviderTypes.Zoom
ProviderTypes.Basecamp or ProviderTypes.Box or ProviderTypes.Dailymotion or
ProviderTypes.Deezer or ProviderTypes.Discord or ProviderTypes.Disqus or
ProviderTypes.Facebook or ProviderTypes.GitHub or ProviderTypes.Harvest or
ProviderTypes.Kook 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.Todoist or
ProviderTypes.Twitter or ProviderTypes.Zoom
=> (string?) context.UserinfoResponse?["id"],
// Bitbucket returns the user identifier as a custom "uuid" node:

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

@ -782,6 +782,31 @@
Description="The URI used to access the Keycloak identity provider (including the realm, if applicable)" />
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ █▀▄██ ▄▄▄ ██ ▄▄▄ ██ █▀▄██
██ ▄▀███ ███ ██ ███ ██ ▄▀███
██ ██ ██ ▀▀▀ ██ ▀▀▀ ██ ██ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="Kook" DisplayName="KOOK" Id="935c58d9-618c-4bc4-9063-944a2c41d03c"
Documentation="https://developer.kookapp.cn/doc/oauth2">
<Environment Issuer="https://www.kookapp.cn/">
<Configuration AuthorizationEndpoint="https://www.kookapp.cn/app/oauth2/authorize"
TokenEndpoint="https://www.kookapp.cn/api/oauth2/token"
UserinfoEndpoint="https://www.kookapp.cn/api/v3/user/me">
<GrantType Value="authorization_code" />
</Configuration>
<!--
Note: Kook requires sending the "get_user_info" scope to be able to use the userinfo endpoint.
-->
<Scope Name="get_user_info" Default="true" Required="true" />
</Environment>
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ █▀▄██ ▄▄▀██ ▄▄▄ ██ ▄▄ ██ ▄▄▄██ ▄▄▀██

Loading…
Cancel
Save