Sha256: ebfdc0247a43d0b034893d8bb5587c0ce6543dabd3c1c335e8081d78ace723ef

Contents?: true

Size: 989 Bytes

Versions: 12

Compression:

Stored size: 989 Bytes

Contents

module Rack::OAuth2::Server
  module IdTokenResponse
    def self.included(klass)
      klass.send :attr_optional, :id_token, :private_key
      klass.class_eval do
        def jwt_string
          if id_token.is_a? OpenIDConnect::ResponseObject::IdToken
            raise AttrRequired::AttrMissing.new("'private_key' required.") unless private_key
            id_token.to_jwt private_key
          else
            id_token
          end
        end

        def protocol_params_with_id_token
          protocol_params_without_id_token.merge(
            :id_token => jwt_string
          )
        end
        alias_method_chain :protocol_params, :id_token
      end
    end
  end
  Token::Response.send :include, IdTokenResponse
  Authorize::Token::Response.send :include, IdTokenResponse
end

require 'rack/oauth2/server/authorize/extension/code_and_id_token'
require 'rack/oauth2/server/authorize/extension/id_token'
require 'rack/oauth2/server/authorize/extension/id_token_and_token'

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openid_connect-0.0.27 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.26 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.25 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.24 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.23 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.22 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.21 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.20 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.19 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.18 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.17 lib/rack/oauth2/server/id_token_response.rb
openid_connect-0.0.16 lib/rack/oauth2/server/id_token_response.rb