Skip to content

Commit

Permalink
Fail if OIDC config contains hosted domains (dexidp#2937)
Browse files Browse the repository at this point in the history
Signed-off-by: m.nabokikh <[email protected]>
  • Loading branch information
nabokihms authored and michaelliau committed Oct 4, 2023
1 parent de1c925 commit 82fd2b8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions connector/oidc/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ type Config struct {

Scopes []string `json:"scopes"` // defaults to "profile" and "email"

// HostedDomains was an optional list of whitelisted domains when using the OIDC connector with Google.
// Only users from a whitelisted domain were allowed to log in.
// Support for this option was removed from the OIDC connector.
// Consider switching to the Google connector which supports this option.
//
// Deprecated: will be removed in future releases.
HostedDomains []string `json:"hostedDomains"`

// Certificates for SSL validation
RootCAs []string `json:"rootCAs"`

Expand Down Expand Up @@ -112,6 +120,10 @@ func knownBrokenAuthHeaderProvider(issuerURL string) bool {
// Open returns a connector which can be used to login users through an upstream
// OpenID Connect provider.
func (c *Config) Open(id string, logger log.Logger) (conn connector.Connector, err error) {
if len(c.HostedDomains) > 0 {
return nil, fmt.Errorf("support for the Hosted domains option had been deprecated and removed, consider switching to the Google connector")
}

httpClient, err := httpclient.NewHTTPClient(c.RootCAs, c.InsecureSkipVerify)
if err != nil {
return nil, err
Expand Down

0 comments on commit 82fd2b8

Please sign in to comment.