JWT:
Any
client that has it can ask for stuff (similar to money when buying stuff)
- No database lookup once issued - embedded expiry dictates validation
JWT has an expiry date and until that time, it will remain valid. This may be undesirable when you need to log out a user on password reset, or forced.
A token blacklist may be used to address the above issues. This will re-introduce persistent or in-memory tracking which JWT was trying to avoid in the first place. However, the tracking will be on selected keys ONLY, whereas, the Basic Token Auth, the tracking is for all users.
JWT can be decoded by anyone who has it. Therefore one needs to be mindful of the information packed in the token. The Basic Auth Token, on the other hand, is just a simple hash, which can be seen as just a reference to a user.
With caching and other performance enhancements in mind, one may not need to worry about the overhead, but the convenience and the future proofing of the flow.
Having full control over authentication, authorization and invalidation is a good thing to have, no matter whether JWT + blacklist or Basic Token Auth is used.
Therefore, the Basic Auth Token may
be better if the flow is customized to address the needs.