While learning how to work with the StackApps APIs, I created quite a few (more than 10) access_token
with no_expiry
scope. Finally I have got my applicaiton working but I am worried that all those access_token
are out open in the wild and on top of that I did not save them anywhere.
Should I be worried?. How do I access the tokens that I created and delete them?
I have created a lot of access_token with no_expiry scope while experimenting. How do I delete them?
1 Answer
This is what the /apps/{accessTokens}/de-authenticate
route does.
Passing valid
access_tokens
to this method causes the application that created them to be de-authorized by the user associated with eachaccess_token
. This will remove the application from their apps tab, and cause all other existingaccess_tokens
to be destroyed.
(Emphasis added)
So if you do not remember a valid access_token
, create a temporary new one for that user and your app.
Then call /2.2/apps/{A_VALID_TOKEN_FOR_USER}/de-authenticate
.
This will invalidate all of that user's tokens for your app.
-
Thanks!. I tested with the current tokens and validated it with some tokens from browser history.– jarCommented Nov 5, 2018 at 18:58