Skip to content

Commit 3e64809

Browse files
andiggopherbot
authored andcommitted
x/oauth2: add Token.ExpiresIn
Fixes golang/go#61417 Change-Id: Ib8599f39b4839bf6eed021217350195ad36d1631 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/605955 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 16a9973 commit 3e64809

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

token.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ type Token struct {
4949
// mechanisms for that TokenSource will not be used.
5050
Expiry time.Time `json:"expiry,omitempty"`
5151

52+
// ExpiresIn is the OAuth2 wire format "expires_in" field,
53+
// which specifies how many seconds later the token expires,
54+
// relative to an unknown time base approximately around "now".
55+
// It is the application's responsibility to populate
56+
// `Expiry` from `ExpiresIn` when required.
57+
ExpiresIn int64 `json:"expires_in,omitempty"`
58+
5259
// raw optionally contains extra metadata from the server
5360
// when updating a token.
5461
raw interface{}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy