venveo / craft-oauthclient

A free to use OAuth 2.0 Client helper for Craft 3 developers
MIT License
9 stars 3 forks source link

How to remove tokens from within the cp? from the console? and by php? #34

Open bencresty opened 3 years ago

bencresty commented 3 years ago

It is possible to connect to the oAuth Auth/Resource server from the CP, which is nice. And I see that all tokens get listed in the Tokens tab. But to my surprise there seems to be no way to remove these tokens from the list once they are in.

I'm probably missing something, but I read the readme and searched on it, but couldn't find it: how can we get rid of the tokens in this list from within the cp and prevent to have an endlessly growing list there?

Thanks!

[edit] Changed the title, because it looks like we're not able to remove tokens at all now (searched everywhere, but couldn't find any way to do this with the plugin. Please tell me if I'm missing something, this is an important feature to have!)

Next to having a way to remove tokens from within the CMS, it's also a really missed action we now can't do from PHP. Which would be needed for cases of hard refreshing AccessTokens for example (or logging in when a Resource Server withdrawn an Access Token for some reason, like described here: https://github.com/venveo/craft-oauthclient/issues/39).

Mosnar commented 3 years ago

Great question - will take a look! It may have just been an oversight on my part.

bencresty commented 3 years ago

While debugging my code I find myself wanting to remove tokens while debugging too, to test code. So for that it would also be very useful.

Is there another way to remove tokens with the plugin?