From 39cafc641fa57cb4139691705cd86eb3e44fecf1 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Wed, 29 Sep 2021 19:42:33 -0700 Subject: [PATCH] Allow to override the listen address when `step oauth` is called. This change allows to override in the token flow a fixed listen address. In some environment like containers it might be difficult to redirect to 127.0.0.1 and we might need to use 0.0.0.0. --- utils/cautils/token_generator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/cautils/token_generator.go b/utils/cautils/token_generator.go index d5f1dce23..55b745bc0 100644 --- a/utils/cautils/token_generator.go +++ b/utils/cautils/token_generator.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "os" "strings" "time" @@ -121,7 +122,7 @@ func generateOIDCToken(ctx *cli.Context, p *provisioner.OIDC) (string, error) { if ctx.Bool("console") { args = append(args, "--console") } - if p.ListenAddress != "" { + if p.ListenAddress != "" && os.Getenv("STEP_LISTEN") == "" { args = append(args, "--listen", p.ListenAddress) } out, err := exec.Step(args...)