Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.
This repository was archived by the owner on May 26, 2020. It is now read-only.

Is it possible to revoke refresh tokens? #288

Open
@alexolivas

Description

@alexolivas

I'm not even sure that this is how refresh tokens are meant to behave, but how can a user effectively notify the system to stop issuing new tokens by using a refresh token in the case their token is compromised?

My settings file contains the following JWT settings

JWT_AUTH = {
    'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300),
    'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),
    'JWT_ALLOW_REFRESH': True,
    'JWT_AUTH_HEADER_PREFIX': 'Token'
}

After a user obtains a valid JWT token from rest_framework_jwt.views.obtain_jwt_token they can use it to access my system's APIs, for up to 7 days by getting new tokens each time using rest_framework_jwt.views.refresh_jwt_token. However, what if one of the expired JWT Tokens is compromised before the refresh token's expiration delta (7 days), couldn't it be used to obtain a valid token by calling the same refresh endpoint? If so, how can a refresh token be revoked so this does not happen?

Note: still trying to wrap my head around using JWT tokens securely

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions