Browse Source

Update the web providers XSD to allow using all the supported client authentication methods

pull/2317/head
Kévin Chalet 11 months ago
parent
commit
a02a7c66ef
  1. 2
      src/OpenIddict.Abstractions/Primitives/OpenIddictParameter.cs
  2. 8
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs
  3. 20
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

2
src/OpenIddict.Abstractions/Primitives/OpenIddictParameter.cs

@ -657,7 +657,7 @@ public readonly struct OpenIddictParameter : IEquatable<OpenIddictParameter>
var result = Value switch
{
// When the parameter is a JsonElement representing an array, return the requested item.
// When the parameter is a JsonElement representing an object, return the requested item.
JsonElement { ValueKind: JsonValueKind.Object } element =>
element.TryGetProperty(name, out JsonElement property) ? new(property) : null,

8
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Revocation.cs

@ -194,14 +194,14 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
// MusicBrainz returns empty revocation responses declared as "text/html" responses.
//
// Since empty HTML payloads are not valid JSON nodes, the Content-Length is manually set
// to 0 to prevent OpenIddict from trying to extract a JSON payload from such responses.
// Since empty HTML payloads are not valid JSON nodes, the Content-Type is manually set
// to null to prevent OpenIddict from trying to extract a JSON payload from such responses.
ProviderTypes.MusicBrainz when response.Content.Headers.ContentLength is 0 => null,
// Reddit returns empty revocation responses declared as "application/json" responses.
//
// Since empty JSON payloads are not valid JSON nodes, the Content-Length is manually set
// to 0 to prevent OpenIddict from trying to extract a JSON payload from such responses.
// Since empty JSON payloads are not valid JSON nodes, the Content-Type is manually set
// to null to prevent OpenIddict from trying to extract a JSON payload from such responses.
ProviderTypes.Reddit when response.Content.Headers.ContentLength is 0 => null,
_ => response.Content.Headers.ContentType

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

@ -64,7 +64,12 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="client_secret_basic" />
<xs:enumeration value="client_secret_jwt" />
<xs:enumeration value="client_secret_post" />
<xs:enumeration value="none" />
<xs:enumeration value="private_key_jwt" />
<xs:enumeration value="self_signed_tls_client_auth" />
<xs:enumeration value="tls_client_auth" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@ -171,7 +176,12 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="client_secret_basic" />
<xs:enumeration value="client_secret_jwt" />
<xs:enumeration value="client_secret_post" />
<xs:enumeration value="none" />
<xs:enumeration value="private_key_jwt" />
<xs:enumeration value="self_signed_tls_client_auth" />
<xs:enumeration value="tls_client_auth" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@ -192,7 +202,12 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="client_secret_basic" />
<xs:enumeration value="client_secret_jwt" />
<xs:enumeration value="client_secret_post" />
<xs:enumeration value="none" />
<xs:enumeration value="private_key_jwt" />
<xs:enumeration value="self_signed_tls_client_auth" />
<xs:enumeration value="tls_client_auth" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
@ -213,7 +228,12 @@
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="client_secret_basic" />
<xs:enumeration value="client_secret_jwt" />
<xs:enumeration value="client_secret_post" />
<xs:enumeration value="none" />
<xs:enumeration value="private_key_jwt" />
<xs:enumeration value="self_signed_tls_client_auth" />
<xs:enumeration value="tls_client_auth" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

Loading…
Cancel
Save