Sha256: 7bc15cf1d07a6fa804e1b2feca4195fede5465e2f1b47bc634d1305da7220f51

Contents?: true

Size: 709 Bytes

Versions: 2

Compression:

Stored size: 709 Bytes

Contents

class Rack::OAuth2::Server::Authorize
  module RequestWithConnectParams
    CONNECT_EXT_PARAMS = [:nonce, :display, :prompt, :request, :request_uri]

    def self.included(klass)
      klass.send :attr_optional, *CONNECT_EXT_PARAMS
      klass.class_eval do
        def initialize_with_connect_params(env)
          initialize_without_connect_params env
          CONNECT_EXT_PARAMS.each do |attribute|
            self.send :"#{attribute}=", params[attribute.to_s]
          end
        end
        alias_method_chain :initialize, :connect_params

        def openid_connect_request?
          scope.include?('openid')
        end
      end
    end
  end
  Request.send :include, RequestWithConnectParams
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openid_connect-0.2.2 lib/rack/oauth2/server/authorize/request_with_connect_params.rb
openid_connect-0.2.1 lib/rack/oauth2/server/authorize/request_with_connect_params.rb