AspNetKatana icon indicating copy to clipboard operation
AspNetKatana copied to clipboard

Enable configuration of Google's 'hosted domain' parameter

Open KerryRitter opened this issue 7 years ago • 4 comments

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.

KerryRitter avatar Feb 27 '18 14:02 KerryRitter

No that's not currently supported. Your best option is to hook into the options.Provider.ApplyRedirect event and add that parameter manually.

Tratcher avatar Feb 27 '18 16:02 Tratcher

Is it reasonable to request it as a future enhancement?

KerryRitter avatar Feb 27 '18 16:02 KerryRitter

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

Tratcher avatar Feb 27 '18 16:02 Tratcher

Understood. Thanks for the insight!

KerryRitter avatar Feb 27 '18 16:02 KerryRitter