outposts/proxy: fix redirect URL error due to callback url not being joined correctly

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-09-10 16:19:29 +02:00
parent e229eda96e
commit 9a79bab43d
2 changed files with 13 additions and 3 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"crypto/tls"
"encoding/gob"
"fmt"
"net/http"
"net/url"
"regexp"
@ -70,7 +69,7 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, cs *ak.CryptoStore
oauth2Config := oauth2.Config{
ClientID: *p.ClientId,
ClientSecret: *p.ClientSecret,
RedirectURL: fmt.Sprintf("%s/akprox/callback", p.ExternalHost),
RedirectURL: urlJoin(p.ExternalHost, "/akprox/callback"),
Endpoint: endpoint.Endpoint,
Scopes: []string{oidc.ScopeOpenID, "profile", "email", "ak_proxy"},
}