Sha256: 08a7f4a842cd4433afc6378115a546b68171548955aab09cc7e4e823c5aa8903

Contents?: true

Size: 983 Bytes

Versions: 9

Compression:

Stored size: 983 Bytes

Contents

module Rack
  module OAuth2
    module Server
      class Authorize
        module Extension
          class CodeAndToken < Abstract::Handler
            class << self
              def response_type_for?(response_type)
                response_type.split.sort == ['code', 'token']
              end
            end

            def call(env)
              @request  = Request.new env
              @response = Response.new request
              super
            end

            class Request < Authorize::Token::Request
              def initialize(env)
                super
                @response_type = [:code, :token]
                attr_missing!
              end
            end

            class Response < Authorize::Token::Response
              attr_required :code

              def redirect_uri_with_credentials
                Util.redirect_uri(super, :query, :code => code)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rack-oauth2-0.10.1 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.10.0 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.10.0.alpha lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.5 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.4 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.3 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.2 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.1 lib/rack/oauth2/server/authorize/extension/code_and_token.rb
rack-oauth2-0.9.0 lib/rack/oauth2/server/authorize/extension/code_and_token.rb