Skip to content

Support padding = signs in Base64 encoding #49

Closed

Description

@zhuowei

https://github.com/brianloveswords/node-jws/blob/master/lib/verify-stream.js#L8 forbids = characters from appearing: however, I came across one web service that used = as Base64 padding. https://jwt.io uses jwt.js, which can parse the token without issue; however, this library complains that this is an invalid token.

Activity

  1. omsmith commented on Apr 24, 2016

    @omsmith
    Contributor

    Hi @zhuowei

    I have to suggest you report a bug to the service in question, they are not complying with the specification.

    #22 #38 #25 #30

  2. gdamjan commented on Feb 23, 2019

    @gdamjan

    maybe we should be more practical here.

    does allowing for = padding have any inadvertent effects?

  3. omsmith commented on Feb 23, 2019

    @omsmith
    Contributor

    Incompatibility with the rest of the ecosystem. Libraries exist across many languages, and node.js alone has at least 5 of them. If we're lenient in accepting malformed signatures here, then the same issue will just be opened in other implementations "node.js' jws accepts this token, but your library does not". It is a vicious cycle.

    There is a spec that clearly says to use base64-url. I don't plan to intentionally accept changes that diverge from it.

  4. gdamjan commented on Feb 25, 2019

    @gdamjan

    the rust and python libraries I've used do work with the AWS token

  5. omsmith commented on Feb 25, 2019

    @omsmith
    Contributor

    We can find examples in both directions. I am aware that Microsoft's .NET library would not accept the token, for instance.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions