Jonathan Law
2 weeks ago
No known key found for this signature in database
GPG Key ID: 7AA5C0DE5101BEB1
3 changed files with
14 additions and
1 deletions
-
src/OpenIddict.Abstractions/OpenIddictConstants.cs
-
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Userinfo.cs
-
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
|
|
@ -547,6 +547,7 @@ public static class OpenIddictConstants |
|
|
public const string Phone = "phone"; |
|
|
public const string Phone = "phone"; |
|
|
public const string Profile = "profile"; |
|
|
public const string Profile = "profile"; |
|
|
public const string Roles = "roles"; |
|
|
public const string Roles = "roles"; |
|
|
|
|
|
public const string Name = "name"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static class Separators |
|
|
public static class Separators |
|
|
|
|
|
@ -512,6 +512,18 @@ public static partial class OpenIddictClientWebIntegrationHandlers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Note: Apple returns a non-standard "name" claim formatted as a JSON object.
|
|
|
|
|
|
else if (context.Registration.ProviderType is ProviderTypes.Apple) |
|
|
|
|
|
{ |
|
|
|
|
|
var name = context.Response[Claims.Name]; |
|
|
|
|
|
if (name is not null) |
|
|
|
|
|
{ |
|
|
|
|
|
context.Response[Claims.Name] = $"{name?["firstName"]} {name?["lastName"]}"; |
|
|
|
|
|
context.Response[Claims.FamilyName] = name?["lastName"]; |
|
|
|
|
|
context.Response[Claims.GivenName] = name?["firstName"]; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return ValueTask.CompletedTask; |
|
|
return ValueTask.CompletedTask; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -1750,7 +1750,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers |
|
|
context.ResponseMode = context.Registration.ProviderType switch |
|
|
context.ResponseMode = context.Registration.ProviderType switch |
|
|
{ |
|
|
{ |
|
|
// Note: Apple requires using form_post when the "email" or "name" scopes are requested.
|
|
|
// Note: Apple requires using form_post when the "email" or "name" scopes are requested.
|
|
|
ProviderTypes.Apple when context.Scopes.Contains(Scopes.Email) || context.Scopes.Contains("name") |
|
|
ProviderTypes.Apple when context.Scopes.Contains(Scopes.Email) || context.Scopes.Contains(Scopes.Name) |
|
|
=> ResponseModes.FormPost, |
|
|
=> ResponseModes.FormPost, |
|
|
|
|
|
|
|
|
_ => context.ResponseMode |
|
|
_ => context.ResponseMode |
|
|
|