Sha256: ce15235a500e33972c8ff359561c68bb5957b346846c94ab08a539af397090ac

Contents?: true

Size: 895 Bytes

Versions: 11

Compression:

Stored size: 895 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module OpenidConnect
    module OAuth
      module PreAuthorization
        attr_reader :nonce

        def initialize(server, attrs = {}, resource_owner = nil)
          super
          @nonce = attrs[:nonce]
        end

        # NOTE: Auto get default response_mode of specified response_type if response_mode is not
        #   yet present. We can delete this method after Doorkeeper's minimize version support it.
        def response_on_fragment?
          return response_mode == 'fragment' if response_mode.present?

          grant_flow = server.authorization_response_flows.detect do |flow|
            flow.matches_response_type?(response_type)
          end

          grant_flow&.default_response_mode == 'fragment'
        end
      end
    end
  end

  OAuth::PreAuthorization.prepend OpenidConnect::OAuth::PreAuthorization
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
doorkeeper-openid_connect-1.8.10 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.8 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.7 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.6 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.5 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.4 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.3 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.2 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.1 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.0 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb
doorkeeper-openid_connect-1.8.0.pre.rc1 lib/doorkeeper/openid_connect/oauth/pre_authorization.rb