forked from remote/oauth2
oauth2: handle token expiry for JWT
Change-Id: I84b4c282ef00e87d13a9b16fdcebd97ea5ed4f4e Reviewed-on: https://go-review.googlesource.com/1650 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
2
jwt.go
2
jwt.go
@@ -131,7 +131,7 @@ func (js jwtSource) Token() (*Token, error) {
|
||||
token.AccessToken, _ = b["access_token"].(string)
|
||||
token.TokenType, _ = b["token_type"].(string)
|
||||
token.raw = b
|
||||
if e, ok := b["expires_in"].(int); ok {
|
||||
if e, ok := b["expires_in"].(float64); ok {
|
||||
token.Expiry = time.Now().Add(time.Duration(e) * time.Second)
|
||||
}
|
||||
if idtoken, ok := b["id_token"].(string); ok {
|
||||
|
||||
Reference in New Issue
Block a user