mirror of
https://github.com/davidallendj/opaal.git
synced 2026-02-04 00:36:26 -07:00
Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8570064235 | ||
|
|
2612978a98 |
2 changed files with 9 additions and 4 deletions
|
|
@ -51,6 +51,9 @@ func NewJwtBearerFlow(eps JwtBearerFlowEndpoints, params JwtBearerFlowParams) (s
|
|||
if client == nil {
|
||||
return "", fmt.Errorf("invalid client (client is nil)")
|
||||
}
|
||||
if verbose {
|
||||
fmt.Printf("ID token (IDP): %s\n access token (IDP): %s", accessToken, idToken)
|
||||
}
|
||||
if accessToken != "" {
|
||||
_, err := jws.Verify([]byte(accessToken), jws.WithKeySet(client.Provider.KeySet), jws.WithValidateKey(true))
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue