Conversation
| */ | ||
| public function revoke_token() { | ||
|
|
||
| $result = $this->post( |
There was a problem hiding this comment.
@mercedesb this will POST to https://api.kit.com/v4/oauth/revoke, sending the client_id and access_token to be revoked. Wanted to check this is the correct call, as couldn't spot any docs on the API site.
src/class-convertkit-api-v4.php
Outdated
| 'revoke', | ||
| array( | ||
| 'client_id' => $this->client_id, | ||
| 'access_token' => $this->access_token, |
There was a problem hiding this comment.
We should change this parameter to token - Doorkeeper will look for token parameter.
I think that you will also need to revoke refresh token separately - it should be enough to make same call and pass it as token parameter.
There was a problem hiding this comment.
I think client_secret is also needed here as well
There was a problem hiding this comment.
We should change this parameter to
token- Doorkeeper will look fortokenparameter.I think that you will also need to revoke refresh token separately - it should be enough to make same call and pass it as
tokenparameter.
I've updated the PR to reflect this, and the associated test to confirm both access and refresh tokens are revoked by attempting to use them with authenticated requests/refreshing tokens.
I think
client_secretis also needed here as well
The WordPress Plugins use PKCE, as the code is public (https://en-gb.wordpress.org/plugins/convertkit/) - so there's no client_secret used. I've confirmed with the changes above that tokens are revoked, so don't believe the client secret is needed.
Summary
Adds the
revoke_tokensmethod, allowing Kit Plugins to revoke an access token when e.g. the user disconnects the Plugin from Kit.Testing
testRevokeTokenstests therevoke_tokensmethod revokes the access and refresh tokensChecklist