Skip to content

Commit

Permalink
Added response body print to debug ID token
Browse files Browse the repository at this point in the history
  • Loading branch information
davidallendj committed Jun 12, 2024
1 parent 2612978 commit 8570064
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/oauth/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 8570064

Please sign in to comment.