Module: SMARTAppLaunch::SMARTClientOptions

Defined in:
lib/smart_app_launch/client_suite/client_options.rb

Constant Summary collapse

SMART_APP_LAUNCH_PUBLIC =
"#{SMART_TAG},#{AUTHORIZATION_CODE_TAG},#{PUBLIC_TAG}".freeze
SMART_APP_LAUNCH_CONFIDENTIAL_SYMMETRIC =
"#{SMART_TAG},#{AUTHORIZATION_CODE_TAG},#{CONFIDENTIAL_SYMMETRIC_TAG}".freeze
SMART_APP_LAUNCH_CONFIDENTIAL_ASYMMETRIC =
"#{SMART_TAG},#{AUTHORIZATION_CODE_TAG},#{CONFIDENTIAL_ASYMMETRIC_TAG}".freeze
SMART_BACKEND_SERVICES_CONFIDENTIAL_ASYMMETRIC =
"#{SMART_TAG},#{CLIENT_CREDENTIALS_TAG},#{CONFIDENTIAL_ASYMMETRIC_TAG}".freeze

Class Method Summary collapse

Class Method Details

.oauth_flow(suite_options) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/smart_app_launch/client_suite/client_options.rb', line 17

def oauth_flow(suite_options)
  if suite_options[:client_type].include?(AUTHORIZATION_CODE_TAG)
    AUTHORIZATION_CODE_TAG
  elsif suite_options[:client_type].include?(CLIENT_CREDENTIALS_TAG)
    CLIENT_CREDENTIALS_TAG
  end
end

.smart_authentication_approach(suite_options) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/smart_app_launch/client_suite/client_options.rb', line 25

def smart_authentication_approach(suite_options)
  if suite_options[:client_type].include?(PUBLIC_TAG)
    PUBLIC_TAG
  elsif suite_options[:client_type].include?(CONFIDENTIAL_SYMMETRIC_TAG)
    CONFIDENTIAL_SYMMETRIC_TAG
  elsif suite_options[:client_type].include?(CONFIDENTIAL_ASYMMETRIC_TAG)
    CONFIDENTIAL_ASYMMETRIC_TAG
  end
end