Browse Source

Update the providers generator to support the AuthorizationResponseIssParameterSupported attribute and use it for the GitHub provider

pull/2530/head
Kévin Chalet 2 weeks ago
parent
commit
515a64faa1
  1. 4
      gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs
  2. 5
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
  3. 6
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

4
gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs

@ -1056,6 +1056,8 @@ public sealed partial class OpenIddictClientWebIntegrationConfiguration
UserInfoEndpoint = CreateUri($""{{ environment.configuration.user_info_endpoint | string.replace '\'' '""' }}"", UriKind.Absolute),
{{~ end ~}}
AuthorizationResponseIssParameterSupported = {{ environment.configuration.authorization_response_iss_parameter_supported ?? ""null"" }},
CodeChallengeMethodsSupported =
{
{{~ for method in environment.configuration.code_challenge_methods_supported ~}}
@ -1342,6 +1344,8 @@ public sealed partial class OpenIddictClientWebIntegrationConfiguration
TokenEndpoint = (string?) configuration.Attribute("TokenEndpoint"),
UserInfoEndpoint = (string?) configuration.Attribute("UserInfoEndpoint"),
AuthorizationResponseIssParameterSupported = (bool?) configuration.Attribute("AuthorizationResponseIssParameterSupported"),
CodeChallengeMethodsSupported = configuration.Elements("CodeChallengeMethod").ToList() switch
{
{ Count: > 0 } methods => methods.Select(static type => (string?) type.Attribute("Value")).ToList(),

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

@ -1086,11 +1086,12 @@
<Provider Name="GitHub" Id="87edae0b-e71e-4163-960f-cf7e2a780d77"
Documentation="https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps">
<Environment Issuer="https://github.com/">
<Environment Issuer="https://github.com/login/oauth">
<Configuration AuthorizationEndpoint="https://github.com/login/oauth/authorize"
DeviceAuthorizationEndpoint="https://github.com/login/device/code"
TokenEndpoint="https://github.com/login/oauth/access_token"
UserInfoEndpoint="https://api.github.com/user">
UserInfoEndpoint="https://api.github.com/user"
AuthorizationResponseIssParameterSupported="true">
<CodeChallengeMethod Value="S256" />
<GrantType Value="authorization_code" />

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

@ -276,6 +276,12 @@
<xs:documentation>The userinfo endpoint offered by the environment.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="AuthorizationResponseIssParameterSupported" type="xs:boolean" use="optional">
<xs:annotation>
<xs:documentation>A boolean indicating whether the authorization response 'iss' parameter is supported by the environment.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>

Loading…
Cancel
Save