git.iko.soy/typeable/oauth2-proxy
on master help sign in
fix redirect url param handling (#10)

* Added conditional to prevent user-supplied redirect URL getting clobbered Change-type: patch * use redirectURL as OAuthCallbackURL (as it should be!) Change-type: patch

commit549766666ef0c9989f8f63b250f27f6b43c37f84 authordt-rush <nick.eightfold.hunter@gmail.com> dateTue 5 Mar 2019, 09:58 (8 years ago) parent66c5eb3
2 files changed+5−2
CHANGELOG.md+1 oauthproxy.go+4−2
CHANGELOG.md+1
@@ -5,6 +5,7 @@
55- [#68](https://github.com/pusher/oauth2_proxy/pull/68) forward X-Auth-Access-Token header (@davidholsgrove)
66- [#41](https://github.com/pusher/oauth2_proxy/pull/41) Added option to manually specify OIDC endpoints instead of relying on discovery
77- [#83](https://github.com/pusher/oauth2_proxy/pull/83) Add `id_token` refresh to Google provider (@leki75)
8+- [#10](https://github.com/pusher/oauth2_proxy/pull/10) fix redirect url param handling (@dt-rush)
89
910# v3.1.0
1011
oauthproxy.go+4−2
@@ -183,7 +183,9 @@ func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy {
183183 }
184184
185185 redirectURL := opts.redirectURL
186− redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix)
186+ if redirectURL.String() == "" {
187+ redirectURL.Path = fmt.Sprintf("%s/callback", opts.ProxyPrefix)
188+ }
187189
188190 log.Printf("OAuthProxy configured for %s Client ID: %s", opts.provider.Data().ProviderName, opts.ClientID)
189191 refresh := "disabled"
@@ -218,7 +220,7 @@ func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy {
218220 SignInPath: fmt.Sprintf("%s/sign_in", opts.ProxyPrefix),
219221 SignOutPath: fmt.Sprintf("%s/sign_out", opts.ProxyPrefix),
220222 OAuthStartPath: fmt.Sprintf("%s/start", opts.ProxyPrefix),
221− OAuthCallbackPath: fmt.Sprintf("%s/callback", opts.ProxyPrefix),
223+ OAuthCallbackPath: redirectURL.Path,
222224 AuthOnlyPath: fmt.Sprintf("%s/auth", opts.ProxyPrefix),
223225
224226 ProxyPrefix: opts.ProxyPrefix,