Skip to content

difference to JWT #70

Closed
Closed

Description

@tcurdt

Not really a bug or a feature request - but a request for clarification in the README.

Why would one use the this project over JWT?
JWT also supports signing and encryption - and is a standard.

I am not making a case for either - but it would be nice to read a position on this.

Activity

  1. elithrar commented on Jan 29, 2020

    @elithrar
    Contributor
  2. tcurdt commented on Jan 29, 2020

    @tcurdt
    Author

    The JWT can be used as cookie or a header. Where you store them or how you send them certainly is an important aspect. But JWT is a signed or even encrypted JSON blob that is standardized. Which seems quite close to what this lib does.

    I am well aware of some of the drawbacks, but those seem to apply to the securecookie project as well.
    Other than a maybe simpler implementation I am still not sure why securecookie should be used over JWT.

  3. elithrar commented on Jan 30, 2020

    @elithrar
    Contributor
  4. danielvladco commented on Dec 10, 2021

    @danielvladco

    A big drawback of JWT in my opinion is that the payload is base64 encoded, meaning it can be easily decoded and expose internal or even sensitive data. Check https://www.ory.sh/hydra/docs/advanced/#json-web-tokens for example

  5. tcurdt commented on Dec 10, 2021

    @tcurdt
    Author

    A big drawback of JWT in my opinion is that the payload is base64 encrypted, meaning it can be easily decrypted and expose internal or even sensitive data. Check https://www.ory.sh/hydra/docs/advanced/#json-web-tokens for example

    There is no such thing as "base64 encryption" - it's an encoding. Being easy to decode is a given.
    And nobody (in the right mind) would use JWT without encryption.

    If you enforce a certain encryption with JWT, the difference to securecookie isn't quite that obvious (to me).

    Clearing up that difference was the original intend of the issue/question.

  6. danielvladco commented on Dec 10, 2021

    @danielvladco

    @tcurdt you are right, I meant encoded.

    But even if you use TLS you still need to store the jwt on the client side as a cooke or in localStorage where it is unencrypted.

  7. tcurdt commented on Dec 10, 2021

    @tcurdt
    Author

    But even if you use TLS you still need to store the jwt on the client side as a cooke or in localStorage where it is unencrypted.

    Why would you want to do that?

    All you need is the encrypted and encoded token to gain access to server side resources.
    On the server side it can be decoded and decrypted.

  8. danielvladco commented on Dec 10, 2021

    @danielvladco

    But even if you use TLS you still need to store the jwt on the client side as a cooke or in localStorage where it is unencrypted.

    Why would you want to do that?

    All you need is the encrypted and encoded token to gain access to server side resources. On the server side it can be decoded and decrypted.

    Ok, I think I understand what you mean, when you say token encryption you refer to JWE? I was thinking about TLS encryption.

    But why you say "nobody (in the right mind) would use JWT without encryption" ? I've seen a lot of applications use JWT without encryption, actually from my experience the majority don't use JWE

  9. elithrar commented on Dec 10, 2021

    @elithrar
    Contributor
  10. jamesli2021 commented on Nov 5, 2023

    @jamesli2021

    I think this discussion is still not complete. The question is whether a stolen JWT token can be use to impersonate user? There are other security mechanism we can employ in addition to JWT or other encrypted session.

  11. bencodesall commented on Feb 12, 2024

    @bencodesall

    I think this discussion is still not complete. The question is whether a stolen JWT token can be use to impersonate user? There are other security mechanism we can employ in addition to JWT or other encrypted session.

    I think @jamesli2021 has a good question here. I'd love to hear some more talk on this, as well as the mentioned "other security mechanism[s]" that can be used with JWT and encrypted sessions.

    Any good concise references for a green-ish auth/auth-er to find good and accessible info?

  12. locked and limited conversation to collaborators on Feb 13, 2024
  13. converted this issue into a discussion #87 on Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions