Browse Source
Add Clever to the list of supported providers
pull/2041/head
Jonathan Law
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
25 additions and
0 deletions
-
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
-
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
@ -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> |
|
|
|
|
|
|
|
<!-- |
|
|
|
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ |
|
|
|
██ ▄▄▀██ ▄▄▄ ██ ▄▄ ██ ▀██ █▄ ▄█▄▄ ▄▄██ ▄▄▄ ██ |
|
|
|
|