fix loading config from openid config_url (#8503)

master
Kanagaraj M 5 years ago committed by Harshavardhana
parent 822eb5ddc7
commit 4082764d48
  1. 14
      cmd/config/identity/openid/jwt.go

@ -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

Loading…
Cancel
Save