From 292df7e355e19fa01e1c2d39e5a7c368e18723ed Mon Sep 17 00:00:00 2001 From: Thomas Recloux Date: Thu, 7 May 2015 11:19:11 +0200 Subject: [PATCH] Authenticate client using basic authentication. http://tools.ietf.org/html/rfc6749#section-2.3.1 --- oauthproxy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oauthproxy.go b/oauthproxy.go index 33f46984b..a52e1304b 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -205,6 +205,8 @@ func (p *OauthProxy) redeemCode(host, code string) (string, string, error) { return "", "", err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + b64 := base64.StdEncoding.EncodeToString([]byte(p.clientID + ":" + p.clientSecret)) + req.Header.Set("Authorization","Basic " + b64) json, err := api.Request(req) if err != nil { log.Printf("failed making request %s", err)