Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
[KEYCLOAK-10633] Fix oauth uri slash issue when using base-uri
Browse files Browse the repository at this point in the history
  • Loading branch information
n1330 committed Mar 22, 2020
1 parent 008527a commit 01956b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01956b7

Please sign in to comment.