goth icon indicating copy to clipboard operation
goth copied to clipboard

OpenID Connect and default http Client

Open pierre-vigier opened this issue 6 years ago • 0 comments

In the OpenID Connect provider, it's not possible to change the http Client used to fetch the discovery url.

	openidConnect, _ := openidConnect.New(os.Getenv("OPENID_CONNECT_KEY"), os.Getenv("OPENID_CONNECT_SECRET"), "http://localhost:3000/auth/openid-connect/callback", os.Getenv("OPENID_CONNECT_DISCOVERY_URL"))
	if openidConnect != nil {
		goth.UseProviders(openidConnect)
	}

Setting openidConnect. HTTPClient after new will not work as the call to the Discovery endpoint is done within the new function by calling openIDConfig, err := getOpenIDConfig(p, openIDAutoDiscoveryURL)

Happy to work on a PR, but i am not sure how to approach that, i could create a new New with a parameter for the http client, but that would break the pattern and stand out from the other provider. Any suggestion on how to allow to change the HTTPClient there?a package variable in the openid connect provider could work as well, and modification of the Client function

pierre-vigier avatar Jun 19 '19 09:06 pierre-vigier