Added response body print to debug ID token

This commit is contained in:
David Allen 2024-06-12 14:01:24 -06:00
parent 2612978a98
commit 8570064235
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -109,12 +109,14 @@ func (client *Client) FetchTokenFromAuthenticationServer(code string, state stri
}
res, err := http.PostForm(client.Provider.Endpoints.Token, body)
if err != nil {
return nil, fmt.Errorf("failed to get ID token: %s", err)
return nil, fmt.Errorf("failed to get ID token: %v", err)
}
b, err := io.ReadAll(res.Body)
if err != nil {
return nil, fmt.Errorf("failed to read response body: %v", err)
}
fmt.Printf("%s\n", string(b))
defer res.Body.Close()
// domain, _ := url.Parse("http://127.0.0.1")
// client.Jar.SetCookies(domain, res.Cookies())
return io.ReadAll(res.Body)
}