--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/770d7f25-72cd-4e1b-862e-467eb64d9054%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.
The token cache automatically removes expired tokens, so you should never get an expired token from getAuthToken. If the tokens are actually getting revoked, the only way to know is when you get back a 401 from an API call. When you do get a 401 on an API call, you can call chrome.identity.removeCachedAuthToken to flush the token from the cache before you call getAuthToken again. See, for example, the xhrWithAuth function in the Identity API sample.
Chrome isn't informed when tokens get revoked on the server side, so there's no way for it to tell your app that the revocation happened.
On Tue, Nov 12, 2013 at 3:53 AM, smitten <roy.sm...@gmail.com> wrote:
The onInstall hook for my extension calls chrome.identity.getAuthToken(). If this is the first time I've run the app, all works OK.The issue I have is that during testing, I am revoking access and then re-installing the extension. In this scenario, getAuthToken() is returning the cached, invalid token. Some time later, my extension is failing 401 when I try to use the extension. What I want to do is to detect that the extension has come from the cache, and immediately remove it so I can do the auth dialogue. If I could access the token expiration time, I could deduce its validity, but afaik, the expiration time isn't visible.Any suggestions on how to code around this?
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
The token cache automatically removes expired tokens, so you should never get an expired token from getAuthToken. If the tokens are actually getting revoked, the only way to know is when you get back a 401 from an API call. When you do get a 401 on an API call, you can call chrome.identity.removeCachedAuthToken to flush the token from the cache before you call getAuthToken again. See, for example, the xhrWithAuth function in the Identity API sample.
Chrome isn't informed when tokens get revoked on the server side, so there's no way for it to tell your app that the revocation happened.
On Tue, Nov 12, 2013 at 3:53 AM, smitten <roy.sm...@gmail.com> wrote:
The onInstall hook for my extension calls chrome.identity.getAuthToken(). If this is the first time I've run the app, all works OK.The issue I have is that during testing, I am revoking access and then re-installing the extension. In this scenario, getAuthToken() is returning the cached, invalid token. Some time later, my extension is failing 401 when I try to use the extension. What I want to do is to detect that the extension has come from the cache, and immediately remove it so I can do the auth dialogue. If I could access the token expiration time, I could deduce its validity, but afaik, the expiration time isn't visible.Any suggestions on how to code around this?
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.