mirror of
https://github.com/openziti/zrok.git
synced 2024-11-22 08:03:49 +01:00
separate out the OAuth host config from HostMatch (#404)
This commit is contained in:
parent
4c0cfa2815
commit
957e50412e
@ -18,6 +18,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
type OauthConfig struct {
|
||||
Host string
|
||||
Port int
|
||||
RedirectUrl string
|
||||
HashKeyRaw string
|
||||
|
@ -334,11 +334,10 @@ func basicAuthRequired(w http.ResponseWriter, realm string) {
|
||||
}
|
||||
|
||||
func oauthLoginRequired(w http.ResponseWriter, r *http.Request, shrToken string, pcfg *Config, provider, target string, authCheckInterval time.Duration) {
|
||||
http.Redirect(w, r, fmt.Sprintf("http://%s.%s:%d/%s/login?targethost=%s&checkInterval=%s", shrToken, pcfg.HostMatch, pcfg.Oauth.Port, provider, url.QueryEscape(target), authCheckInterval.String()), http.StatusFound)
|
||||
http.Redirect(w, r, fmt.Sprintf("http://%s.%s:%d/%s/login?targethost=%s&checkInterval=%s", shrToken, pcfg.Oauth.Host, pcfg.Oauth.Port, provider, url.QueryEscape(target), authCheckInterval.String()), http.StatusFound)
|
||||
}
|
||||
|
||||
func resolveService(hostMatch string, host string) string {
|
||||
logrus.Debugf("host = '%v'", host)
|
||||
if hostMatch == "" || strings.Contains(host, hostMatch) {
|
||||
tokens := strings.Split(host, ".")
|
||||
if len(tokens) > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user