auth0 / node-jws

JSON Web Signatures
http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html
MIT License
709 stars 108 forks source link

Using base64url with atob and btoa like way #14

Closed frantello closed 9 years ago

frantello commented 9 years ago

Hi all,

since payload can contains claims with latin characters.

Node-jws module should use atob and btob like base64 compresion, from binary instead of string.

Thanks for sharing.

frantello commented 9 years ago

I'm still thinking about this, maybe the correct fix is in base64url module. Base64url should have the option of encoding from and to binary for compatibility with atob and btoa.

frantello commented 9 years ago

Ok, now it's working like a charm. :)

Please, considers to merge my change.

It fixes compatibility with window.atob browser implementatios when base64url contains latin characters encoded. It's needed to decode the JSON web token at client side.

Thanks so much.

brianloveswords commented 9 years ago

@frantello I accepted your changes to base64url and pushed up v1.0.4, can you update the package.json in this PR to that and test again?

frantello commented 9 years ago

@brianloveswords, done!

blase64url updated to ~1.0.4 and node-jwa to ~0.0.2.

I would help with node-jwa version update. It's working with old base64url implementation, although not really matter for now, node-jwa is not using the patched functions.

brianloveswords commented 9 years ago

Okay, this is pushed out! I made it v1.0.0 since I've been meaning to promote it anyway.