Skip to content

Commit

Permalink
docs: add missing GitLab provider to the list of supported OIDC provi…
Browse files Browse the repository at this point in the history
…ders (#766)
  • Loading branch information
NickUfer committed Oct 14, 2020
1 parent 0ada8af commit a43ed33
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions selfservice/strategy/oidc/provider_config.go
Expand Up @@ -19,6 +19,9 @@ type Configuration struct {
// Provider is either "generic" for a generic OAuth 2.0 / OpenID Connect Provider or one of:
// - generic
// - google
// - github
// - gitlab
// - microsoft
Provider string `json:"provider"`

// ClientID is the application's Client ID.
Expand Down Expand Up @@ -76,19 +79,25 @@ func (c ConfigurationCollection) Provider(id string, public *url.URL) (Provider,
for k := range c.Providers {
p := c.Providers[k]
if p.ID == id {
var providerNames []string
var addProviderName = func(pn string) string {
providerNames = append(providerNames, pn)
return pn
}

switch p.Provider {
case "generic":
case addProviderName("generic"):
return NewProviderGenericOIDC(&p, public), nil
case "google":
case addProviderName("google"):
return NewProviderGoogle(&p, public), nil
case "github":
case addProviderName("github"):
return NewProviderGitHub(&p, public), nil
case "gitlab":
case addProviderName("gitlab"):
return NewProviderGitLab(&p, public), nil
case "microsoft":
case addProviderName("microsoft"):
return NewProviderMicrosoft(&p, public), nil
}
return nil, errors.Errorf("provider type %s is not supported, supported are: %v", p.Provider, []string{"generic", "google", "github", "microsoft"})
return nil, errors.Errorf("provider type %s is not supported, supported are: %v", p.Provider, providerNames)
}
}
return nil, errors.WithStack(herodot.ErrNotFound.WithReasonf(`OpenID Connect Provider "%s" is unknown or has not been configured`, id))
Expand Down

0 comments on commit a43ed33

Please sign in to comment.