You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is true ?
When i request to Exchange token with auth code
in /token/internal.go line 240
body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20))
r.Body.Close()
if err != nil {
return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err)
}
the output is
{
"access_token": ",
"expires_in": 3594,
"scope": ",
"token_type": "Bearer",
"id_token": ""
}
but the type tokenJSON struct in line 281 is
type tokenJSON struct {
AccessToken string json:"access_token"
TokenType string json:"token_type"
RefreshToken string json:"refresh_token"
ExpiresIn expirationTime json:"expires_in" // at least PayPal returns string, while most return number
// error fields
// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
ErrorCode string json:"error"
ErrorDescription string json:"error_description"
ErrorURI string json:"error_uri"
}
this is the reason why cant unmarshal to struct and not see the refresh token when Exchange.
If I'm wrong, please give me the right reasons. Thank you.
The text was updated successfully, but these errors were encountered:
fusesuphasin
changed the title
Cant Unmarshal to type tokenJSON struct in v0.10.0
Cant Unmarshal Exchange refresh token to type tokenJSON struct in v0.10.0
Jul 21, 2023
This is true ?
When i request to Exchange token with auth code
in /token/internal.go line 240
body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20))
r.Body.Close()
if err != nil {
return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err)
}
the output is
{
"access_token": ",
"expires_in": 3594,
"scope": ",
"token_type": "Bearer",
"id_token": ""
}
but the type tokenJSON struct in line 281 is
type tokenJSON struct {
AccessToken string
json:"access_token"
TokenType string
json:"token_type"
RefreshToken string
json:"refresh_token"
ExpiresIn expirationTime
json:"expires_in"
// at least PayPal returns string, while most return number// error fields
// https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
ErrorCode string
json:"error"
ErrorDescription string
json:"error_description"
ErrorURI string
json:"error_uri"
}
this is the reason why cant unmarshal to struct and not see the refresh token when Exchange.
If I'm wrong, please give me the right reasons. Thank you.
The text was updated successfully, but these errors were encountered: