Skip to content

Commit

Permalink
Allow to override the listen address when step oauth is called.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maraino committed Sep 30, 2021
1 parent 9fc33a6 commit 39cafc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/cautils/token_generator.go
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"time"

Expand Down Expand Up @@ -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...)
Expand Down

0 comments on commit 39cafc6

Please sign in to comment.