Skip to content

Commit

Permalink
OIDC connector option to override jwksURI (#3543)
Browse files Browse the repository at this point in the history
Signed-off-by: sohgaura <tiwari.dk1@gmail.com>
Signed-off-by: sohgaura <31881670+sohgaura@users.noreply.github.com>
  • Loading branch information
sohgaura committed May 31, 2024
1 parent 569e0cc commit 064a409
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions connector/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ type ProviderDiscoveryOverrides struct {
// AuthURL provides a way to user overwrite the Auth URL
// from the .well-known/openid-configuration authorization_endpoint
AuthURL string `json:"authURL"`
// JWKSURL provides a way to user overwrite the JWKS URL
// from the .well-known/openid-configuration jwks_uri
JWKSURL string `json:"jwksURL"`
}

func (o *ProviderDiscoveryOverrides) Empty() bool {
return o.TokenURL == "" && o.AuthURL == ""
return o.TokenURL == "" && o.AuthURL == "" && o.JWKSURL == ""
}

func getProvider(ctx context.Context, issuer string, overrides ProviderDiscoveryOverrides) (*oidc.Provider, error) {
Expand Down Expand Up @@ -151,7 +154,9 @@ func getProvider(ctx context.Context, issuer string, overrides ProviderDiscovery
if overrides.AuthURL != "" {
config.AuthURL = overrides.AuthURL
}

if overrides.JWKSURL != "" {
config.JWKSURL = overrides.JWKSURL
}
return config.NewProvider(context.Background()), nil
}

Expand Down

0 comments on commit 064a409

Please sign in to comment.