Closed GoogleCodeExporter closed 9 years ago
I'm not sure that signing out in another window would necessarily revoke the
access token granted to the application -- applications should continue to have
access even if the user logs out, at least until the token expires. Are you
finding that not to be the case?
But, you bring up a good -- though unrelated -- point. There is no way for an
application to know that the token has been *revoked*, for example by visiting
https://www.google.com/accounts/b/0/IssuedAuthSubTokens and revoking access to
an application. I believe Facebook has a similar page.
So storing the token may result in using a token that's been revoked elsewhere,
which will only present itself when a request is made with that token, and the
response will be an authorization 4XX error.
Unfortunately the protocol doesn't provide any mechanism of getting notified
that a token has been revoked, so the best we can do is either:
1.) Always check authorization status before making any request. This would
require the library to be able to be configured to disable token storage (which
is a good idea anyway, by the sounds of it), and would result in an
auto-closing popup to be displayed before each request. That's...not a great
experience.
2.) Don't pre-check authorization, but catch failed requests that fail because
of a bad token, and automatically refresh the token and retry the request. This
will require deeper integration with the requesting mechanism (JSONP in most
cases), and in fact is planned to be supported for Google APIs as part of
ongoing integration with the GALGWT project. This should be a better user
experience, but requires a little more work on your/my part :) -- Luckily, this
method also allows for tokens to be stored, so that a popup doesn't have to be
opened on each request. It's win-win! :)
If you need more details, I'd be happy to help, I'm not familiar with any
problem with tokens after the user logs out of the service provider, so more
details there would be helpful.
Original comment by jasonhall@google.com
on 8 Jun 2011 at 4:57
I'm going to mark this as Invalid since it seems to be outside the scope of a
pure OAuth 2.0 library. I've described some methods by which you can integrate
your request mechanism with this library to do smarter things, which should fix
the problem you describe.
Original comment by jasonhall@google.com
on 21 Jul 2011 at 3:07
Original issue reported on code.google.com by
karthik....@gmail.com
on 8 Jun 2011 at 3:49