Enable configuration of Google's 'hosted domain' parameter
I have been unable to find any documentation on how to do this in the current implementation so I apologize if this functionality exists.
For Google OAuth redirections, Google supports a "hosted domain" parameter ("hd" in the request) to specify restrictions on domains allowed to login. It would be great to have a GoogleOptions parameter to support this parameter.
See https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters for example.
No that's not currently supported. Your best option is to hook into the options.Provider.ApplyRedirect event and add that parameter manually.
Is it reasonable to request it as a future enhancement?
Sure, though we don't have any releases scheduled at the moment. I expect it would go here: https://github.com/aspnet/AspNetKatana/blob/64bf627964ca9bd312cfda31916194212731c11c/src/Microsoft.Owin.Security.Google/GoogleOAuth2AuthenticationHandler.cs#L196-L200
Understood. Thanks for the insight!