Export to GitHub

gwt-oauth2 - issue #8

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


Posted on Aug 31, 2011 by Helpful Giraffe

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.

Comment #1

Posted on Sep 7, 2011 by Helpful Giraffe

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)

Status: Fixed