@@ -22,6 +22,7 @@ public static partial class OpenIddictClientWebIntegrationHandlers
2222 /*
2323 * Authentication processing:
2424 */
25+ DisableIssuerParameterValidation . Descriptor ,
2526 ValidateRedirectionRequestSignature . Descriptor ,
2627 HandleNonStandardFrontchannelErrorResponse . Descriptor ,
2728 ValidateNonStandardParameters . Descriptor ,
@@ -68,6 +69,45 @@ public static partial class OpenIddictClientWebIntegrationHandlers
6869 .. UserInfo . DefaultHandlers
6970 ] ;
7071
72+ /// <summary>
73+ /// Contains the logic responsible for disabling the issuer parameter validation for the providers that require it.
74+ /// </summary>
75+ public sealed class DisableIssuerParameterValidation : IOpenIddictClientHandler < ProcessAuthenticationContext >
76+ {
77+ /// <summary>
78+ /// Gets the default descriptor definition assigned to this handler.
79+ /// </summary>
80+ public static OpenIddictClientHandlerDescriptor Descriptor { get ; }
81+ = OpenIddictClientHandlerDescriptor . CreateBuilder < ProcessAuthenticationContext > ( )
82+ . UseSingletonHandler < DisableIssuerParameterValidation > ( )
83+ . SetOrder ( ValidateIssuerParameter . Descriptor . Order - 500 )
84+ . SetType ( OpenIddictClientHandlerType . BuiltIn )
85+ . Build ( ) ;
86+
87+ /// <inheritdoc/>
88+ public ValueTask HandleAsync ( ProcessAuthenticationContext context )
89+ {
90+ ArgumentNullException . ThrowIfNull ( context ) ;
91+
92+ context . DisableIssuerParameterValidation = context . Registration . ProviderType switch
93+ {
94+ // Google is currently rolling out a change that causes the "iss" authorization response
95+ // parameter to be returned without the "authorization_response_iss_parameter_supported"
96+ // flag being advertised in the provider metadata. Since OpenIddict rejects authorization
97+ // responses that contain an issuer if "authorization_response_iss_parameter_supported" is
98+ // not explicitly set to true, validation must be disabled until the deployment is complete.
99+ //
100+ // See https://github.com/openiddict/openiddict-core/issues/2428 for more information.
101+ ProviderTypes . Google when context . Request . HasParameter ( Parameters . Iss ) &&
102+ context . Configuration . AuthorizationResponseIssParameterSupported is not true => true ,
103+
104+ _ => context . DisableIssuerParameterValidation
105+ } ;
106+
107+ return ValueTask . CompletedTask ;
108+ }
109+ }
110+
71111 /// <summary>
72112 /// Contains the logic responsible for validating the signature or message authentication
73113 /// code attached to the redirection request for the providers that require it.
0 commit comments