Added verbose print to show ID and access tokens from IDP

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

View file

@ -51,6 +51,9 @@ func NewJwtBearerFlow(eps JwtBearerFlowEndpoints, params JwtBearerFlowParams) (s
if client == nil { if client == nil {
return "", fmt.Errorf("invalid client (client is 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 != "" { if accessToken != "" {
_, err := jws.Verify([]byte(accessToken), jws.WithKeySet(client.Provider.KeySet), jws.WithValidateKey(true)) _, err := jws.Verify([]byte(accessToken), jws.WithKeySet(client.Provider.KeySet), jws.WithValidateKey(true))
if err != nil { if err != nil {