From bdcf369b3da8811a9a898adfa1ce1c0f703c6da6 Mon Sep 17 00:00:00 2001 From: CDN18 Date: Mon, 10 Jun 2024 14:05:15 +0800 Subject: [PATCH] add client_id and client_secret to exchangeOauthCode form --- oauth_generic.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oauth_generic.go b/oauth_generic.go index 25c162b..36f166c 100644 --- a/oauth_generic.go +++ b/oauth_generic.go @@ -70,6 +70,8 @@ func (c genericOauthClient) buildLoginURL(state string) (string, error) { func (c genericOauthClient) exchangeOauthCode(ctx context.Context, code string) (*TokenResponse, error) { form := url.Values{} + form.Add("client_id", c.ClientID) + form.Add("client_secret", c.ClientSecret) form.Add("grant_type", "authorization_code") form.Add("redirect_uri", c.CallbackLocation) form.Add("scope", c.Scope)