Rename hostname to base-url for accuracy
This commit is contained in:
parent
b1621501a2
commit
c54a1f8d9a
@ -91,7 +91,7 @@ func init() {
|
||||
startCmd.Flags().StringP("port", "p", "", "Port to listen on")
|
||||
startCmd.Flags().String("oidc-sp-client-id", "", "OIDC Client ID")
|
||||
startCmd.Flags().String("oidc-idp-issuer-url", "", "Identity Provider Issuer URL")
|
||||
startCmd.Flags().String("hostname", "", "Address at which the server is exposed")
|
||||
startCmd.Flags().String("base-url", "", "Address at which the server is exposed")
|
||||
startCmd.Flags().String("env", "", "Environment (development/production)")
|
||||
|
||||
startCmd.Flags().String("oidc-sp-client-secret", "", "OIDC Client Secret")
|
||||
|
@ -49,7 +49,7 @@ func Setup() (*Config, error) {
|
||||
oauthConfig := &oauth2.Config{
|
||||
ClientID: viper.GetString("oidc-sp-client-id"),
|
||||
ClientSecret: viper.GetString("oidc-sp-client-secret"),
|
||||
RedirectURL: viper.GetString("hostname") + "/callback",
|
||||
RedirectURL: viper.GetString("base-url") + "/callback",
|
||||
Endpoint: provider.Endpoint(),
|
||||
Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
|
||||
}
|
||||
@ -250,7 +250,7 @@ func (c *Config) LogoutHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Add query parameters
|
||||
q := keycloakLogoutURL.Query()
|
||||
// Use logout-callback for completing the logout flow
|
||||
q.Set("post_logout_redirect_uri", viper.GetString("hostname")+"/logout-callback")
|
||||
q.Set("post_logout_redirect_uri", viper.GetString("base-url")+"/logout-callback")
|
||||
q.Set("client_id", viper.GetString("oidc-sp-client-id"))
|
||||
q.Set("state", state)
|
||||
|
||||
@ -342,7 +342,7 @@ func (c *Config) RegistrationHandler(w http.ResponseWriter, r *http.Request) {
|
||||
q.Set("client_id", viper.GetString("oidc-sp-client-id"))
|
||||
q.Set("response_type", "code")
|
||||
q.Set("scope", "openid email profile")
|
||||
q.Set("redirect_uri", viper.GetString("hostname")+"/callback")
|
||||
q.Set("redirect_uri", viper.GetString("base-url")+"/callback")
|
||||
q.Set("state", state)
|
||||
q.Set("nonce", nonce)
|
||||
q.Set("code_challenge", codeChallenge)
|
||||
|
@ -9,6 +9,6 @@ port: 8081
|
||||
oidc-sp-client-id: "member-console"
|
||||
oidc-sp-client-secret: ""
|
||||
oidc-idp-issuer-url: "http://localhost:8080/realms/master"
|
||||
hostname: "http://localhost:8081"
|
||||
base-url: "http://localhost:8081"
|
||||
session-secret: ""
|
||||
csrf-secret: ""
|
@ -9,6 +9,6 @@ port: 8081
|
||||
oidc-sp-client-id: "member-console"
|
||||
oidc-sp-client-secret: "CigQbREzhFCekZ8yvV3CaCFrHOgANgaH"
|
||||
oidc-idp-issuer-url: "http://localhost:8080/realms/master"
|
||||
hostname: "http://localhost:8081"
|
||||
base-url: "http://localhost:8081"
|
||||
session-secret: "rJcniy2aWl3vwBcrMJfqsTL+Wys7EwDx/RC+DRrKcYg="
|
||||
csrf-secret: "e157b42a5b608882179cb4ac69c12f84"
|
Loading…
x
Reference in New Issue
Block a user