Module: Doorkeeper::OpenidConnect::OAuth::PreAuthorization

Defined in:
lib/doorkeeper/openid_connect/oauth/pre_authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nonceObject (readonly)

Returns the value of attribute nonce.



7
8
9
# File 'lib/doorkeeper/openid_connect/oauth/pre_authorization.rb', line 7

def nonce
  @nonce
end

Instance Method Details

#initialize(server, attrs = {}, resource_owner = nil) ⇒ Object



9
10
11
12
# File 'lib/doorkeeper/openid_connect/oauth/pre_authorization.rb', line 9

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

#response_on_fragment?Boolean

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.

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
# File 'lib/doorkeeper/openid_connect/oauth/pre_authorization.rb', line 16

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