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 this using Microsoft.Owin.Security.OpenIdConnect assembly. Even We cannot find how to add a standard request parameter to Authentication Request (e.g. "login_hint parameter").
For example Google has "login_hint" and "hd" parameters (https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest), and we want to have almost the same parameters. But we even cannot find how to send these parameters to Google using Owin. Tried this code:
var googleOptions = new GoogleOAuth2AuthenticationOptions()
{
ClientId = "...",
ClientSecret = "...",
};
app.UseGoogleAuthentication(googleOptions);
...
public ActionResult ExternalLogin(string provider)
{
var ctx = Request.GetOwinContext();
var properties = new AuthenticationProperties();
properties.Dictionary.Add("login_hint ", "myemail@gmail.com");
properties.Dictionary.Add("hd", "hd");
ctx.Authentication.Challenge(properties, provider);
return new HttpUnauthorizedResult();
}
But Authentication request url will be generated without "login_hint" and "hd" parameters.
Will be very grateful for any help to resolve this problem.