diff --git a/config.go b/config.go index 080af6ad3..f2c871d57 100644 --- a/config.go +++ b/config.go @@ -77,10 +77,10 @@ func newDefaultConfig() *Config { // WithOAuthURI returns the oauth uri func (r *Config) WithOAuthURI(uri string) string { if r.BaseURI != "" { - return fmt.Sprintf("%s/%s/%s", r.BaseURI, r.OAuthURI, uri) + return fmt.Sprintf("%s%s%s", r.BaseURI, r.OAuthURI, uri) } - return fmt.Sprintf("%s/%s", r.OAuthURI, uri) + return fmt.Sprintf("%s%s", r.OAuthURI, uri) } // isValid validates if the config is valid diff --git a/handlers.go b/handlers.go index d04c285f9..8021b4c09 100644 --- a/handlers.go +++ b/handlers.go @@ -63,7 +63,7 @@ func (r *oauthProxy) getRedirectionURL(w http.ResponseWriter, req *http.Request) w.WriteHeader(http.StatusForbidden) return "" } - return fmt.Sprintf("%s%s", redirect, r.config.WithOAuthURI("callback")) + return fmt.Sprintf("%s%s", redirect, r.config.WithOAuthURI(callbackURL)) } // oauthAuthorizationHandler is responsible for performing the redirection to oauth provider