Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url safe encode and decode #28

Closed
beekus opened this issue Jan 14, 2014 · 1 comment
Closed

url safe encode and decode #28

beekus opened this issue Jan 14, 2014 · 1 comment

Comments

@beekus
Copy link

beekus commented Jan 14, 2014

This issue pops up when I am trying to make a JWT assertion to a service that isn't implemented using this gem. I think there may be an issue with base64url_encode.

body = JWT.encode({'foo' => 'bar'}, nil, nil).split('.').last
=> "eyJmb28iOiJiYXIifQ"
Base64.decode64(body)
=> "{\"foo\":\"bar\""

Shouldn't there be a closing curly brace on the above? I think you can use Base64.urlsafe_encode64 and Base64::urlsafe_decode64 instead of what you are doing in lines 38-45. I can submit a pull request with this unless there are any objections.

@beekus
Copy link
Author

beekus commented Jan 15, 2014

further reading leads me to believe that i am wrong.

@beekus beekus closed this as completed Jan 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant