We have our own OpenID Connect Provider. We want to pass custom query parameter in Authentication request using Owin middleware. And we cannot find the way how to implement
So, having struggled with a similar type of issue, brockallen sent me some code that gives me what I need using identity server 3....
class CustomGoogleAuthProvider : GoogleOAuth2AuthenticationProvider
{
public CustomGoogleAuthProvider()
{
OnApplyRedirect = (GoogleOAuth2ApplyRedirectContext context) =>
{
var signinId = context.OwinContext.Request.Query["signin"];
var msg = context.OwinContext.Environment.GetSignInMessage(signinId);
var hint = msg.LoginHint;
var newRedirectUri = context.RedirectUri;
newRedirectUri += string.Format("&login_hint={0}", HttpUtility.UrlEncode(hint));
context.Response.Redirect(newRedirectUri);
};
}
}