Skip to content

Commit 78e2de6

Browse files
new: Migrating legacy expire endpoint /oauth/token/expire to /oauth/revoke (#352)
1 parent 27161d7 commit 78e2de6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

linode_api4/login_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,10 @@ def refresh_oauth_token(self, refresh_token):
490490

491491
def expire_token(self, token):
492492
"""
493-
Given a token, makes a request to the authentication server to expire
494-
it immediately. This is considered a responsible way to log out a
495-
user. If you simply remove the session your application has for the
493+
Given a token, makes a request to the authentication server to expire both
494+
access token and refresh token.
495+
This is considered a responsible way to log out a user.
496+
If you remove only the session your application has for the
496497
user without expiring their token, the user is not _really_ logged out.
497498
498499
:param token: The OAuth token you wish to expire
@@ -504,8 +505,9 @@ def expire_token(self, token):
504505
:raises ApiError: If the expiration attempt failed.
505506
"""
506507
r = requests.post(
507-
self._login_uri("/oauth/token/expire"),
508+
self._login_uri("/oauth/revoke"),
508509
data={
510+
"token_type_hint": "access_token",
509511
"client_id": self.client_id,
510512
"client_secret": self.client_secret,
511513
"token": token,

0 commit comments

Comments
 (0)