Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

initializer broken by ruby-jwt api changes #43

Closed
subuta opened this issue Feb 29, 2016 · 3 comments
Closed

initializer broken by ruby-jwt api changes #43

subuta opened this issue Feb 29, 2016 · 3 comments

Comments

@subuta
Copy link

subuta commented Feb 29, 2016

I found config.token_secret_signature_key was broken by ruby-jwt API updates ...

# config.token_secret_signature_key = -> { JWT.base64url_decode Rails.application.secrets.auth0_client_secret }

Latest ruby-jwt(v1.5.3) completely removes base64url_decode method from JWT module(at this PR)

BTW, We may use these work around as a temporary solution :)
(we may have better solution for this problem...)

require 'base64'

# extracted from original [method](http://www.rubydoc.info/github/jwt/ruby-jwt/JWT.base64url_decode)
config.token_secret_signature_key = -> {
    secret = Rails.application.secrets.auth0_client_secret
    secret += '=' * (4 - secret.length.modulo(4))
    Base64.decode64(secret.tr('-_', '+/'))
  }
@solsberg
Copy link

solsberg commented Mar 3, 2016

Thanks for the workaround, works for me also

@nsarno
Copy link
Owner

nsarno commented Mar 4, 2016

There's an issue open in ruby-jwt (jwt/ruby-jwt#133) because of 1.5.3 breaking compatibility with 1.5.2. The breaking version is going to be yanked and re-released as 1.6.0 so it should be all good after that.

I'll let this issue open for people to see the workaround in the meantime. Thanks for your help @subuta !

@nsarno
Copy link
Owner

nsarno commented Apr 8, 2016

jwt/ruby-jwt#133

@nsarno nsarno closed this as completed Apr 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants