Properly parse expiration time

The golang oauth2 library's `Token` doesn't have an "expires_in"
field. Instead oauth2 internally parses the expiration into a future
unix timestamp. So before this patch, the tokens that oauth2device
was producing didn't properly capture the expiration time. This patch
fixes it by copying the logic from oauth2, which is unfortunately
not exposed in a way that we can directly use.

Change-Id: Idec2632c5d4cb272d9d2e8e0099972ad9dda9c3d
1 file changed
tree: 28b65bfe1bbabecb8a4a17f6cbc097197e9a2545
  1. LICENSE.md
  2. README.md
  3. doc.go
  4. doc_test.go
  5. googledevice/
  6. oauth2device.go
README.md

Golang OAuth2.0 for Devices

This package implements a small shim atop https://github.com/golang/oauth2 to support Google's OAuth2.0 flow for devices.

See the documentation for more details.