Browse Source

Add Clever to the list of supported providers

pull/2041/head
Jonathan Law 2 years ago
committed by GitHub
parent
commit
bad9c11f48
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
  2. 13
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

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

@ -478,6 +478,18 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
context.Response[Claims.Subject] = (string?) context.Response[Claims.Subject];
}
// Note: Clever returns a non-standard "name" claim formatted as a JSON object.
else if (context.Registration.ProviderType is ProviderTypes.Clever)
{
var name = context.Response[Claims.Name]?.GetNamedParameters();
if (name is not null)
{
context.Response[Claims.Name] = $"{name["first"]} {name["last"]}";
context.Response[Claims.FamilyName] = name["last"];
context.Response[Claims.GivenName] = name["first"];
}
}
return default;
}

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

@ -309,6 +309,19 @@
</Environment>
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▀██ █████ ▄▄▄██ ███ █ ▄▄▄██ ▄▄▀██
██ █████ █████ ▄▄▄███ █ ██ ▄▄▄██ ▀▀▄██
██ ▀▀▄██ ▀▀ ██ ▀▀▀███▄▀▄██ ▀▀▀██ ██ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="Clever" Id="8DF11BBC-B8A8-4A8D-8C5F-AD86D9539BBA"
Documentation="https://dev.clever.com/docs/oauth-oidc-overview">
<Environment Issuer="https://clever.com/" />
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▀██ ▄▄▄ ██ ▄▄ ██ ▀██ █▄ ▄█▄▄ ▄▄██ ▄▄▄ ██

Loading…
Cancel
Save