Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Fix issue where username/password are not encoded for basic auth #4796

Merged
merged 2 commits into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jetstream/authuaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (p *portalProxy) getUAAToken(body url.Values, skipSSLValidation bool, clien
return nil, fmt.Errorf(msg, err)
}

req.SetBasicAuth(client, clientSecret)
req.SetBasicAuth(url.QueryEscape(client), url.QueryEscape(clientSecret))
req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationForm)

var h = p.GetHttpClientForRequest(req, skipSSLValidation)
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/plugins/metrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (m *MetricsSpecification) Connect(ec echo.Context, cnsiRecord interfaces.CN

func (m *MetricsSpecification) addAuth(req *http.Request, auth *MetricsAuth) {
if auth.Type == interfaces.AuthConnectTypeCreds {
req.SetBasicAuth(auth.Username, auth.Password)
req.SetBasicAuth(url.QueryEscape(auth.Username), url.QueryEscape(auth.Password))
}
}

Expand Down