module OpenIDConnect::JWTnizable
Public Instance Methods
as_jwt(key, algorithm = :RS256) { |token| ... }
click to toggle source
# File lib/openid_connect/jwtnizable.rb, line 7 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
to_jwt(key, algorithm = :RS256, &block)
click to toggle source
# File lib/openid_connect/jwtnizable.rb, line 3 def to_jwt(key, algorithm = :RS256, &block) as_jwt(key, algorithm, &block).to_s end