Sha256: 5cebd6cd0415059dd00b8042af558e657125ca19ef3e4e6b4e25e04d5a3efeb2

Contents?: true

Size: 349 Bytes

Versions: 37

Compression:

Stored size: 349 Bytes

Contents

module OpenIDConnect
  module JWTnizable
    def to_jwt(key, algorithm = :RS256, &block)
      as_jwt(key, algorithm, &block).to_s
    end

    def as_jwt(key, algorithm = :RS256, &block)
      token = JSON::JWT.new as_json
      yield token if block_given?
      token = token.sign key, algorithm if algorithm != :none
      token
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
openid_connect-2.3.1 lib/openid_connect/jwtnizable.rb
openid_connect-2.3.0 lib/openid_connect/jwtnizable.rb
openid_connect-2.2.1 lib/openid_connect/jwtnizable.rb
openid_connect-2.2.0 lib/openid_connect/jwtnizable.rb
openid_connect-2.1.0 lib/openid_connect/jwtnizable.rb
openid_connect-2.0.0 lib/openid_connect/jwtnizable.rb
openid_connect-2.0.0.rc1 lib/openid_connect/jwtnizable.rb
openid_connect-1.4.2 lib/openid_connect/jwtnizable.rb
openid_connect-1.4.1 lib/openid_connect/jwtnizable.rb
openid_connect-1.4.0 lib/openid_connect/jwtnizable.rb
openid_connect-1.3.1 lib/openid_connect/jwtnizable.rb
openid_connect-1.3.0 lib/openid_connect/jwtnizable.rb
openid_connect-1.2.0 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.8 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.7 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.6 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.5 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.4 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.3 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.2 lib/openid_connect/jwtnizable.rb