When using OpenIddict's client, values set in AuthenticationProperties.Items during a challenge don't automatically appear in the outgoing OAuth2 authorization request. To forward a custom parameter like 'provider', you must register a handler for OpenIddictClientEvents.PrepareAuthorizationRequestContext, read the property from context.Transaction, and set it directly on context.Request. For apps using the built-in Microsoft OpenIdConnect middleware instead, the equivalent hook is OpenIdConnectEvents.OnRedirectToIdentityProvider, where you write to context.ProtocolMessage.Parameters. On the server side, the forwarded value arrives as a plain query string parameter with no OpenIddict-specific handling needed.

4m read timeFrom bartwullems.blogspot.com
Post cover image
Table of contents
Why this doesn't just workRegistering the handlerUsing the built-in OpenIdConnect handler insteadReading it back on the serverMore information
709 Impressions