No need to configure issuer
This commit is contained in:
parent
97ffa21262
commit
36370f8f2a
@ -15,9 +15,12 @@ import (
|
|||||||
"github.com/dexidp/dex/connector"
|
"github.com/dexidp/dex/connector"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
issuerURL = "https://accounts.google.com"
|
||||||
|
)
|
||||||
|
|
||||||
// Config holds configuration options for OpenID Connect logins.
|
// Config holds configuration options for OpenID Connect logins.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Issuer string `json:"issuer"`
|
|
||||||
ClientID string `json:"clientID"`
|
ClientID string `json:"clientID"`
|
||||||
ClientSecret string `json:"clientSecret"`
|
ClientSecret string `json:"clientSecret"`
|
||||||
RedirectURI string `json:"redirectURI"`
|
RedirectURI string `json:"redirectURI"`
|
||||||
@ -34,7 +37,7 @@ type Config struct {
|
|||||||
func (c *Config) Open(id string, logger logrus.FieldLogger) (conn connector.Connector, err error) {
|
func (c *Config) Open(id string, logger logrus.FieldLogger) (conn connector.Connector, err error) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
provider, err := oidc.NewProvider(ctx, c.Issuer)
|
provider, err := oidc.NewProvider(ctx, issuerURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cancel()
|
cancel()
|
||||||
return nil, fmt.Errorf("failed to get provider: %v", err)
|
return nil, fmt.Errorf("failed to get provider: %v", err)
|
||||||
|
Reference in New Issue
Block a user