Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default OIDC callback listener to only listen on localhost #86

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

const defaultMount = "oidc"
const defaultListenAddress = "localhost"
const defaultPort = "8250"
const defaultCallbackHost = "localhost"
const defaultCallbackMethod = "http"
Expand All @@ -43,6 +44,11 @@ func (h *CLIHandler) Auth(c *api.Client, m map[string]string) (*api.Secret, erro
mount = defaultMount
}

listenAddress, ok := m["listenaddress"]
if !ok {
listenAddress = defaultListenAddress
}

port, ok := m["port"]
if !ok {
port = defaultPort
Expand Down Expand Up @@ -94,7 +100,7 @@ func (h *CLIHandler) Auth(c *api.Client, m map[string]string) (*api.Secret, erro
doneCh <- loginResp{secret, err}
})

listener, err := net.Listen("tcp", ":"+port)
listener, err := net.Listen("tcp", listenAddress+":"+port)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -239,14 +245,17 @@ Configuration:
role=<string>
Vault role of type "OIDC" to use for authentication.

listenaddress=<string>
Optional address to bind the OIDC callback listener to (default: localhost).

port=<string>
Optional localhost port to use for OIDC callback (default: 8250).
Optional localhost port to use for OIDC callback (default: 8250).

callbackmethod=<string>
Optional method to to use in OIDC redirect_uri (default: http).
Optional method to to use in OIDC redirect_uri (default: http).

callbackhost=<string>
Optional callback host adddress to use in OIDC redirect_uri (default: localhost).
Optional callback host address to use in OIDC redirect_uri (default: localhost).
kalafut marked this conversation as resolved.
Show resolved Hide resolved

callbackport=<string>
Optional port to to use in OIDC redirect_uri (default: the value set for port).
Expand Down