# Propagation improvement

* fixes documentation and variable names on oauth token revocation
* introduces private key for propagation
* changes key usage in decryption of propagated user data from oauth_client_id to private propagation key
This commit is contained in:
2024-12-23 10:45:08 +01:00
parent 1c24cbea26
commit 9149e4cbd3
5 changed files with 17 additions and 11 deletions

View File

@@ -155,15 +155,18 @@ class OAuthToken(UuidModel):
return user
def revoke(self) -> (int, int):
""" Revokes the tokens of the user
def revoke(self) -> int:
""" Revokes the OAuth2 token of the user
(/o/revoke_token/ indeed removes the corresponding access token on provider side and invalidates the
submitted refresh token in one step)
Returns:
revocation_status_codes (tuple): HTTP status code for revocation of access_token and refresh_token
revocation_status_code (int): HTTP status code for revocation of refresh_token
"""
revoke_url = f"{SSO_SERVER_BASE}o/revoke_token/"
token = self.refresh_token
revocation_status_codes = requests.post(
revocation_status_code = requests.post(
revoke_url,
data={
'token': token,
@@ -172,5 +175,5 @@ class OAuthToken(UuidModel):
auth=(OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET),
).status_code
return revocation_status_codes
return revocation_status_code