Skip to content

Token stored in OutstandingToken and actual token are different when token payload is modified. #717

Open
@ss-bhat

Description

@ss-bhat

The simple JWT document says we can customize token claims from TokenObtainPairSerializer -> get_token class method.

However, if we customize the token according to the above document and enable the blacklist app, the token stored in the OutstandingToken model is different. Because the BlacklistMixin -> for_user is executed before modifying the token.

If the tokens are different, it will be difficult in identifying the token while blacklisting.

Reference:

OutstandingToken.objects.create(
user=user,
jti=jti,
token=str(token),
created_at=token.current_time,
expires_at=datetime_from_epoch(exp),
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions