fix loading config from openid config_url (#8503)

This commit is contained in:
Kanagaraj M 2019-11-11 23:01:46 +05:30 committed by Harshavardhana
parent 822eb5ddc7
commit 4082764d48

View File

@ -282,6 +282,13 @@ func LookupConfig(kv config.KVS, transport *http.Transport, closeRespFn func(io.
jwksURL = env.Get(EnvIdentityOpenIDJWKSURL, kv.Get(JwksURL))
}
c = Config{
ClaimPrefix: env.Get(EnvIdentityOpenIDClaimPrefix, kv.Get(ClaimPrefix)),
publicKeys: make(map[string]crypto.PublicKey),
transport: transport,
closeRespFn: closeRespFn,
}
configURL := env.Get(EnvIdentityOpenIDURL, kv.Get(ConfigURL))
if configURL != "" {
c.URL, err = xnet.ParseHTTPURL(configURL)
@ -308,13 +315,6 @@ func LookupConfig(kv config.KVS, transport *http.Transport, closeRespFn func(io.
return c, nil
}
c = Config{
ClaimPrefix: env.Get(EnvIdentityOpenIDClaimPrefix, kv.Get(ClaimPrefix)),
publicKeys: make(map[string]crypto.PublicKey),
transport: transport,
closeRespFn: closeRespFn,
}
c.JWKS.URL, err = xnet.ParseHTTPURL(jwksURL)
if err != nil {
return c, err