mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Added response body print to debug ID token
This commit is contained in:
parent
8c01ba897f
commit
a7e0e73e45
1 changed files with 6 additions and 4 deletions
|
|
@ -109,12 +109,14 @@ func (client *Client) FetchTokenFromAuthenticationServer(code string, state stri
|
||||||
}
|
}
|
||||||
res, err := http.PostForm(client.Provider.Endpoints.Token, body)
|
res, err := http.PostForm(client.Provider.Endpoints.Token, body)
|
||||||
if err != nil {
|
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()
|
defer res.Body.Close()
|
||||||
|
|
||||||
// domain, _ := url.Parse("http://127.0.0.1")
|
|
||||||
// client.Jar.SetCookies(domain, res.Cookies())
|
|
||||||
|
|
||||||
return io.ReadAll(res.Body)
|
return io.ReadAll(res.Body)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue