xuanhau / gwt-oauth2

Automatically exported from code.google.com/p/gwt-oauth2
Apache License 2.0
0 stars 0 forks source link

Method to get information about a token by its service/scopes #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to be able to query the library for whether or not a token has 
been stored for a particular service, more specifically for an authUrl/scopes 
combo, potentially with added information about whether the token is expired or 
how long before it expires.

The API might look something like this:

boolean isExpired = Auth.getTokenInfo("https://google.auth.url", 
"buzz.scope").isExpired();
long expiresInMs = Auth.getTokenInfo("https://facebook.auth.url", 
"email").expiresIn();

This should be exported as a JS method as well, and should be covered in the 
sample code.

Original issue reported on code.google.com by jasonhall@google.com on 31 Aug 2011 at 3:01

GoogleCodeExporter commented 9 years ago
Fixed in r32

This change only adds the expiresIn() method, but it's easy to see whether a 
token is set (expiresIn() != Double.NEGATIVE_INFINITY) or is expired 
(expiresIn() > 0)

Original comment by jasonhall@google.com on 7 Sep 2011 at 7:06