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-1.1.1 lib/openid_connect/jwtnizable.rb
openid_connect-1.1.0 lib/openid_connect/jwtnizable.rb
openid_connect-1.0.3 lib/openid_connect/jwtnizable.rb
openid_connect-1.0.2 lib/openid_connect/jwtnizable.rb
openid_connect-1.0.1 lib/openid_connect/jwtnizable.rb
openid_connect-1.0.0 lib/openid_connect/jwtnizable.rb
openid_connect-0.12.0 lib/openid_connect/jwtnizable.rb
openid_connect-0.11.2 lib/openid_connect/jwtnizable.rb
openid_connect-0.11.1 lib/openid_connect/jwtnizable.rb
openid_connect-0.11.0 lib/openid_connect/jwtnizable.rb
openid_connect-0.10.0 lib/openid_connect/jwtnizable.rb
openid_connect-0.9.2 lib/openid_connect/jwtnizable.rb
openid_connect-0.9.1 lib/openid_connect/jwtnizable.rb
openid_connect-0.9.0 lib/openid_connect/jwtnizable.rb
openid_connect-0.8.3 lib/openid_connect/jwtnizable.rb
openid_connect-0.8.2 lib/openid_connect/jwtnizable.rb
openid_connect-0.8.1 lib/openid_connect/jwtnizable.rb