From c830d49884452f9560141bbbf100e67d2e318f33 Mon Sep 17 00:00:00 2001 From: Tomasz Kleczek Date: Tue, 5 May 2020 17:03:12 +0200 Subject: [PATCH] allow no secret for static public clients For statically-configured public clients it should be allowed for both Secret and SecretEnv fields to be empty. --- cmd/dex/serve.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dex/serve.go b/cmd/dex/serve.go index 27fba306..5c8732aa 100644 --- a/cmd/dex/serve.go +++ b/cmd/dex/serve.go @@ -166,7 +166,7 @@ func serve(cmd *cobra.Command, args []string) error { } c.StaticClients[i].ID = os.Getenv(client.IDEnv) } - if client.Secret == "" && client.SecretEnv == "" { + if client.Secret == "" && client.SecretEnv == "" && !client.Public { return fmt.Errorf("invalid config: Secret or SecretEnv field is required for client %q", client.ID) } if client.SecretEnv != "" {